From d10da56560c850e3f05dcfa858f0f773b9b198c4 Mon Sep 17 00:00:00 2001 From: Niklas Schwarz Date: Thu, 7 Dec 2023 11:51:29 +0100 Subject: [PATCH] Add the abillity to configure the logging options Add the ability to configure the logging options for the rabbitmq-server via the rabbitmq_log variable and key-value pairs Change-Id: If9f28f29311150ed7b8ba61d2ddf7e12ca07d3c4 --- defaults/main.yml | 5 +++++ .../rabbitmq_logging_config-5f96836fb1ce6c2c.yaml | 9 +++++++++ templates/rabbitmq.conf.j2 | 10 ++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/rabbitmq_logging_config-5f96836fb1ce6c2c.yaml diff --git a/defaults/main.yml b/defaults/main.yml index c98680d0..0696d353 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -250,6 +250,11 @@ rabbitmq_hipe_compile: False # Disable non-TLS listeners rabbitmq_disable_non_tls_listeners: False +# RabbitMQ logging options +# See https://www.rabbitmq.com/logging.html for the logging options +rabbitmq_log: + journald: True + file: False # RabbitMQ policies # Used to tune performance characteristics of OpenStack messaging diff --git a/releasenotes/notes/rabbitmq_logging_config-5f96836fb1ce6c2c.yaml b/releasenotes/notes/rabbitmq_logging_config-5f96836fb1ce6c2c.yaml new file mode 100644 index 00000000..657c2f06 --- /dev/null +++ b/releasenotes/notes/rabbitmq_logging_config-5f96836fb1ce6c2c.yaml @@ -0,0 +1,9 @@ +--- + +features: + - | + Add the abbility to configure the logging options with the variable + ``rabbitmq_log`` of the rabbitmq-server using key-value pairs. The + default values for journald (true) and file (false) are keept but + more options (see https://www.rabbitmq.com/logging.html) can be + configured now. diff --git a/templates/rabbitmq.conf.j2 b/templates/rabbitmq.conf.j2 index 75a9e9a6..ab010e2a 100644 --- a/templates/rabbitmq.conf.j2 +++ b/templates/rabbitmq.conf.j2 @@ -1,8 +1,14 @@ collect_statistics_interval = {{ rabbitmq_collect_statistics_interval }} -log.journald = true -log.file = false +{% for key, value in rabbitmq_log.items() %} +{% if value is boolean %} +log.{{ key }} = {{ value | lower }} +{% else %} +log.{{ key }} = {{ value }} +{% endif%} +{% endfor %} + heartbeat = 640 ssl_handshake_timeout = 20000 handshake_timeout = 40000