I am using the rabbitmq:3.10
image locally on my mac. By default rabbitmq emits info logs to console which can lead to a good amount of logging noise.
According to the documentation configuration changes such as logging changes can be adjusted via an additional .conf
file in a separate folder that is declared via the RABBITMQ_CONFIG_FILES environment variable.
FROM rabbitmq:3.10
ENV RABBITMQ_CONFIG_FILES=/local/my-conf.d/
COPY ./config/ /local/my-conf.d/
RUN chown -r rabbitmq:rabbitmq /local/my-conf.d/
In my local conf
folder I have the file ‘disable_logging.conf’ with the log level change.
log.console.level = error
I build the image that way
docker build -t rabbitmqlocal .
and run it that way
docker run rabbitmqlocal
Whatever I do, I tried various .conf
files, with or without chown
rabbitmq always stops the boot process with Application syslog exited with reason: stopped
in the logs
2022-09-26 12:41:03.377639+00:00 [notice] <0.44.0> Application syslog exited with reason: stopped
...
Config file(s): /local/my-conf.d/disable_logging.conf
How do I change log level on a local rabbitmq docker container?
2
Answers
Make sure to edit log-level in
rabbitmq.conf
https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbit/docs/rabbitmq.conf.example
For Mac, this file is under
${install_prefix}/etc/rabbitmq/rabbitmq.conf
please see: https://www.rabbitmq.com/configure.html#config-location
Update
But since Docker image is built on top of
ubuntu
:I connected within the container and started the server:
So it is reading configuration from
/etc/rabbitmq/conf.d/10-defaults.conf
You should copy your configuration to path above, re-build again and it should update your log level
Please see a complete working example here:
https://github.com/lukebakken/stackoverflow-73854347
Dockerfile
contents:20-logging.conf
contents:NOTE: the RabbitMQ team monitors the
rabbitmq-users
mailing list and only sometimes answers questions on StackOverflow.