Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 :)

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

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).

You must be logged in to vote
1 reply
Comment options

Thank you so much. I'll try it soon and see if I can figure it out 🙏🏼

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

AltStyle によって変換されたページ (->オリジナル) /