-
I am using nginx-proxy (nginx + dockergen) and acme_companion. docker logs nginx-proxy provides me with logs but its not only access log and only a limited amount of time. How to export the full access.log to the host? /var/log/nginx/access.log is just a symbolic link to /dev/stdout. |
Beta Was this translation helpful? Give feedback.
Answered by
SchoNie
Sep 12, 2023
Replies: 1 comment 5 replies
-
Make a bind mount from volumes:
- "./accesslogs/:/var/log/nginx/" Be carefull that you need to do some kind of logrotation on the access.log/error.log else the file will grow indefinitely. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You do not have a bind mount but a volume. A volume is managed by Docker and normally it's content is not (directly) accessible on the host.
A bind mounts maps a specific folder on the host system to a folder in the docker container.
Change
- proxy_nginx_logs:/var/log/nginx/ # this volume should be for the logs
to- ./accesslogs/:/var/log/nginx/
And comment or remove
proxy_nginx_logs:
in the volumes: section.This should create a "accesslogs" folder in the folder containing the docker-compose file which is bind mounted to the accesslog folder in the container..
And that folder should then contain the accesslogs which you should do logrotation on.