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