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?
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:
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.
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_LOGSandRABBITMQ_SASL_LOGSsince we set them to std out in the Dockerfile:https://github.com/docker-library/rabbitmq/blob/ba7ea670b5c084417d1f03cb07012314ba51c57a/3.6/debian/Dockerfile#L53-L55