docker-library / rabbitmq

Docker Official Image packaging for RabbitMQ
http://www.rabbitmq.com/
MIT License
780 stars 412 forks source link

Consider including logrotate #717

Closed michaelklishin closed 2 months ago

michaelklishin commented 2 months ago

Apparently some folks run containers and log to local file storage. For such cases, it would be great to include logrotate into the image, and I guess making mounting a config file easier.

Thoughts?

michaelklishin commented 2 months ago

The background of this was https://github.com/rabbitmq/rabbitmq-server/discussions/11873#discussioncomment-10207880.

Given that I have updated the docs to explain the behavior https://github.com/rabbitmq/rabbitmq-website/commit/2a8d9ea8aeb54ca7237be04eacdfd3100db1e71b, maybe this is not really relevant.

Although logrotate is more powerful and flexible than anything a tool such as RabbitMQ usually provides as a built-in option.

Zerpet commented 2 months ago

Logging to local storage is a bit of an anti-pattern in containers. If you want to have logs for long term storage and analysis, you would use a different Docker log driver, or configure your app to emit logs via OpenTelemetry, and ship them to a logging system. The later, of course, it's not possible in RabbitMQ today (it may never be). It is possible, however, to configure a logging driver to write to an external system e.g. Splunk, or to write stdout/stderr to a local file in the Docker host, and ingest that file by a logging system.

michaelklishin commented 2 months ago

Yes, I agree. Let's close this.