I have nginx running inside the jwilder/nginx-proxy docker container. In order to persist the logs on the host machine through container restarts, I added the following to my compose file:
services:
...
nginx-proxy:
...
volumes:
- /host-path/nginx-logs:/var/log/nginx
This conveniently made existing server logs accessible on the host machine. However now when executing docker logs
command for that machine, nginx access and error logs are no longer visible in the terminal output. This was an unintended consequence. In other logging libs, I know it’s pretty simple to specify console versus file transports. Is that possible with docker?