Hi,
I want to set my log levels to warning through environment variables passed through docker-compose. Setting this as documented in the official docker hub image's documentation
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{warning}]
I get a
Using deprecated config parameter 'log_levels'. Please update your configuration file according to https://rabbitmq.com/logging.html
So then I tried setting it likes this:
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit.log.console.level warning
But this just keeps on printing Info to console as well. What's wrong here?
Doing "echo 'log.console.level = warning' >> /etc/rabbitmq/rabbitmq.conf"
from inside the container seems to do the trick for me, so I'd recommend
dropping that into a short Dockerfile and setting up an automated build or
similar.
Bump on this. Can anyone tell me what I'm doing wrong here? This is part of my docker stack yaml:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbit log [{file,[{file,\"/var/log/rabbitmq/error.log\"},{level,error},{date,\"$D0\"},{size,10485760},{count,3}]},{console,[{enabled,false}]}]"
The container fails to start with this; I'm still working on converting my yaml to a docker run command so I can see the specific error it outputs.
Update: if I start this container using docker run with the same env arguments, it starts up fine.
docker run -itd ^
--privileged ^
--name=rabbit-test ^
-v /var/log ^
-v /tmp ^
--ulimit nofile=65536:65536 ^
-e RABBITMQ_SASL_LOGS="/var/log/rabbitmq/error.sasl.log" ^
-e RABBITMQ_LOGS="/var/log/rabbitmq/error.log" ^
-e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbit log [{file,[{file,\"/var/log/rabbitmq/error.log\"},{level,error},{date,\"$D0\"},{size,10485760},{count,3}]},{console,[{enabled,false}]}]" ^
rabbitmq:3-management
In your YAML, you're including the " around your value, which get included verbatim -- remove/move the double quotes and your value should work:
- "RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log [{file,[{file,\"/var/log/rabbitmq/error.log\"},{level,error},{date,\"$D0\"},{size,10485760},{count,3}]},{console,[{enabled,false}]}]"
Since the original issue here appears to be resolved, I'm going to close. :+1:
Most helpful comment
Doing "echo 'log.console.level = warning' >> /etc/rabbitmq/rabbitmq.conf"
from inside the container seems to do the trick for me, so I'd recommend
dropping that into a short Dockerfile and setting up an automated build or
similar.