Can’t write RabbitMQ logs to a file

  docker, rabbitmq

I have a docker container running a RabbitMQ instance. I want RabbitMQ to write its logs to a file. Therefore I added the following line to my /etc/rabbitmq/rabbitmq.conf file:

log.file = /myfolder/myfile.log

The problem is that it keeps writing its logs to the console. The folder myfolder exists and the root user has the write permission for it.

Source: Docker Questions