-
-
Notifications
You must be signed in to change notification settings - Fork 867
-
Hey,
I could verify that logs are written inside of the container but there doesn't seem to be a way to view those logs through a volume. Is this expected behavior? If so why and is there a good reason to keep it that way? If not how could I change this to display my log files on my host system so that I don't have to ssh into the container fr logs?
Thank you a lot already, I am still learning :)
Beta Was this translation helpful? Give feedback.
All reactions
Hi @YassinS!
By default, logs are written, to simplify things, to Docker container logs. You can access these logs with the docker compose logs command (see https://docs.docker.com/reference/cli/docker/compose/logs/).
In the dev environment, logs are also written to the var/logs/<environment>.log file. To access these logs on the host machine, you need to add a mount point to the var directory:
# compose.override.yaml
services:
php:
volumes:
# ...
+ - ./var:/app/varIf you use PhpStorm, I can also recommend mark the mounted directory as excluded (so that PhpStock does not index this directory; see https://www.jetbrains.com/help/phpstorm/excluding-files-from-project.html
Replies: 1 comment 1 reply
-
Hi @YassinS!
By default, logs are written, to simplify things, to Docker container logs. You can access these logs with the docker compose logs command (see https://docs.docker.com/reference/cli/docker/compose/logs/).
In the dev environment, logs are also written to the var/logs/<environment>.log file. To access these logs on the host machine, you need to add a mount point to the var directory:
# compose.override.yaml
services:
php:
volumes:
# ...
+ - ./var:/app/varIf you use PhpStorm, I can also recommend mark the mounted directory as excluded (so that PhpStock does not index this directory; see https://www.jetbrains.com/help/phpstorm/excluding-files-from-project.html).
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you so much. I'll try it soon and see if I can figure it out 🙏🏼
Beta Was this translation helpful? Give feedback.