-
Describe the bugWhen deploying RabbitMQ version 3.12 in a Kubernetes environment and configuring log rotation parameters according to https://rabbitmq.com/logging.html documentation, the RabbitMQ logs are not rotating as expected. Reproduction steps
Expected behaviorexpect log file rotate, like rabbitmq.log.0,rabbitmq.log.1,rabbitmq.log.2.. Additional contextThis issue only occurs in version 3.12; version 3.8 does not exhibit this problem. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 15 replies
-
RabbitMQ 3.12 is out of community support. IIRC in 3.12 some of those settings were not supported after a migration to a different logger library internally (the settings pre-date the migration, not every library supports every rotation feature). I recommend that you upgrade to 3.13.6 and switch to |
Beta Was this translation helpful? Give feedback.
-
@qc-mq GitHub does not send out notifications for discussions, so I have to use an explicit mention. |
Beta Was this translation helpful? Give feedback.
-
We have the same issue in the newest 3.13 version. Although the |
Beta Was this translation helpful? Give feedback.
-
@qc-mq @absolute8511 the following config: log.file.level = debug
log.console = false
log.file = /tmp/rabbitmq.file.rotation.size.log
log.file.rotation.size = 15000
log.file.rotation.count = 5
log.file.rotation.compress = true and the following Bunny REPL session to generate some log messages: 1000.times { c = Bunny.new(port: 5672); c.start; c.close } Makes
My best guess is that if you set both So you have to pick one, and in my example below |
Beta Was this translation helpful? Give feedback.
-
After asking the maintainers of the Docker image to consider including log rotate, another RabbitMQ core team member has shared this opinion on local logging in containerized environments, which I agree with. |
Beta Was this translation helpful? Give feedback.
I have identified the issue. Setting RABBITMQ_LOGS in the environment variables overrides the log configuration options in the configuration file.
The environment variable mentioned, RABBITMQ_LOGS, according to https://www.rabbitmq.com/docs/logging, should only affect the log.file parameter, which differs from the observed behavior during testing.
Additionally, in version 3.8, there are no issues observed when setting both the RABBITMQ_LOGS environment variable and configuring the log settings in the file simultaneously.