Nginx Docker file is configured to send error.log to /dev/stderr.
RUN ln -sf /dev/stdout /var/log/nginx/access.log
&& ln -sf /dev/stderr /var/log/nginx/error.log
When we run docker logs --tail=10 -f nginx it show a combination of both error log and access log. Is there a docker command so I can only see the logs of error.log or stderr?
Try this command to get only error.log:
docker logs -f nginx 1>/dev/null
And this one for access.log:
docker logs -f nginx 2>/dev/null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With