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: server {
listen 80;
listen [::]:80;
server_name localhost;
charset utf-8;
####
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
####
... 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" |
Answered by
jaydrogers
Apr 24, 2024
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 |
0 replies
Answer selected by
jaydrogers
|
Great! Thank you for so useful answer! Learned alot ! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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