Rabbitmq: No logs are seen in /var/log/rabbitmq

Created on 10 Sep 2017  路  4Comments  路  Source: docker-library/rabbitmq

Hi, i have set env variable

RABBITMQ_LOG_BASE=/var/log/rabbitmq

during service deployment and its value is seen in the container.

But _/var/log/rabbitmq_ is empty.

While doing docker logs -f container_id does show the logs.
Where are the logs stored and how to see them?

Most helpful comment

They are stored in Docker logs which can be configured to be sent to a logging service (for example, via gelf or syslog). If you really need it to write to a file inside the container, then you need to also set RABBITMQ_LOGS and RABBITMQ_SASL_LOGS since we set them to std out in the Dockerfile:

https://github.com/docker-library/rabbitmq/blob/ba7ea670b5c084417d1f03cb07012314ba51c57a/3.6/debian/Dockerfile#L53-L55

All 4 comments

It would help if you clarified how exactly was the environment variable set. Default directory locations are documented.

Hi, Michael.
Thanks.
It was set in service descriptor _yaml_

      ...
      environment:              
        - RABBITMQ_LOG_BASE=/var/log/rabbitmq  
      ...

From the link you provided there are 3 relevant lines:

RABBITMQ_LOG_BASE | ${install_prefix}/var/log/rabbitmq
RABBITMQ_LOGS | $RABBITMQ_LOG_BASE/$RABBITMQ_NODENAME.log
RABBITMQ_SASL_LOGS | $RABBITMQ_LOG_BASE/$RABBITMQ_NODENAME-sasl.log

That's what i'm trying to say: _$RABBITMQ_NODENAME.log_ and _$RABBITMQ_NODENAME-sasl.log_ and are not created in _$RABBITMQ_LOG_BASE_ which was set to _/var/log/rabbitmq_ via given env variable

They are stored in Docker logs which can be configured to be sent to a logging service (for example, via gelf or syslog). If you really need it to write to a file inside the container, then you need to also set RABBITMQ_LOGS and RABBITMQ_SASL_LOGS since we set them to std out in the Dockerfile:

https://github.com/docker-library/rabbitmq/blob/ba7ea670b5c084417d1f03cb07012314ba51c57a/3.6/debian/Dockerfile#L53-L55

Indeed, this is by design -- if you want the logs to go to files, you'll need to unset or override the provided RABBITMQ_LOGS and/or RABBITMQ_SASL_LOGS environment variables.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Thubo picture Thubo  路  6Comments

michaelklishin picture michaelklishin  路  4Comments

michaelkrog picture michaelkrog  路  5Comments

mixxit picture mixxit  路  5Comments

michaelklishin picture michaelklishin  路  4Comments