Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Where is the error.log? #212
I need some advice from more seasoned docker users.
I am extending the official php-image in my Dockerfile like this:
I build the dockerfile with this:
I run the container like this:
I can see the access.log using this:
How can I see the error.log?????
What have you got in your logs? (
Currently I have the following (version 7.0-apache):
Therefore, there might be no file, unless I actually set this variable (currently investigation).
Also, you do not need to access the file. You can probably read it by connecting with ssh (
Now you'll be able to see any PHP error logs as part of the docker container log stream:
docker logs -f your_php_apache_container
To display only errors and hide the access log, you can pipe
docker logs -f your_php_apache_container >/dev/null
To follow only the access log, you can pipe
docker logs -f your_php_apache_container 2>/dev/null
@povils Container apps shouldn't write log files in the container, as its lifecycle is meant to be "disposable", unless you mount a volume and want them on your file system. This is a core tenet of the 12-factor-app methodology.
I believe you enable fluentd and configure logging output. The ephemeral nature of containers is meant to stream logs not write them so you need to capture the stream one layer up, then ship em.…
Sent from my iPhone
On Oct 20, 2017, at 2:51 AM, Povilas Susinskas ***@***.***> wrote: @mikesparr Thanks for the answer. I needed log files because I am using Elastic Filebeat which harvests log files and streams that to our ELK — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.