How to output as a file : docker logs docker-compose-lnmp-php_fpm-1
#324
-
When using How to bind this log as a file between host and container to make it just like nginx-container:
nginx:
image: nginx:1.20.1
volumes:
## config
- ./my_nginx/configs/conf.d:/etc/nginx/conf.d
## log #### by doing this can dynamicly show logs####
- ./my_nginx/logs:/var/log/nginx
## site datas:
- ./www:/var/www
# - ./www:/www
networks:
- lnmp
depends_on:
- php_fpm
expose:
- "80"
ports:
# left:host , right: container
- "801:80" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This is because we send everything to Docker through You can do things like this to save to a file instead https://stackoverflow.com/questions/69613129/how-to-save-the-logs-for-docker-compose-up-d-build |
Beta Was this translation helpful? Give feedback.
-
Great! Thank you for so useful answer! Learned alot ! |
Beta Was this translation helpful? Give feedback.
This is because we send everything to Docker through
stderr/stdout
: https://github.com/search?q=repo%3Aserversideup%2Fdocker-php%20dev%2Fstderr&type=codeYou can do things like this to save to a file instead https://stackoverflow.com/questions/69613129/how-to-save-the-logs-for-docker-compose-up-d-build