Skip to content

Should I be able to see logs on my host system by default? #760

Answered by 7-zete-7
YassinS asked this question in Q&A
Discussion options

You must be logged in to vote

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/var

If 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

Comment options

You must be logged in to vote
1 reply
@YassinS
Comment options

Answer selected by YassinS
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