Skip to content

How to export the full access.log to host as file? #2298

Answered by SchoNie
Emporea asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Emporea
Comment options

@SchoNie
Comment options

@Emporea
Comment options

@SchoNie
Comment options

Answer selected by Emporea
@Emporea
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants