How to collect elasticsearch logs in docker

Hi @Petr.Simik

To get Elasticsearch write the logs to file you either need to do some hacky stuff with docker and the command parameters or modify the log4j2.properties file. I advise you to check out the following site:
https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html

You need to map the new log4j2.properties to the containers and also need a folder mapped into the directory you want to save the logs.

Hope this leads you on the right way.

1 Like