How to extract docker container logs to a file
This article describe how to get information about docker logs and to extract the file to send to the technical team for review.
Firstly, you must identify the CONTAINER ID of the proxy that is running. You can list information about the proxy running in your command-line interface (CLI) with the command:
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.RunningFor}}"
After identify the CONTAINER ID, you can list the log that are currently running executing this command in your command-line interface (CLI):
docker logs <CONTAINER_ID>
For extract in a file the log listed with the command above, you can run the command in your command-line interface (CLI):
docker logs <CONTAINER_ID> &> log_file.log &
The result with this command will be the file in the directory that you executed this command:
It is possible get more information about this subject in the oficial page of docker: https://docs.docker.com/engine/reference/commandline/logs/