Default log file locations

Valentin V. Bartenev vbart at nginx.com
Thu Jun 27 18:19:45 UTC 2019


On Thursday 27 June 2019 19:44:22 Peter Bittner wrote:
> I may be a bit ignorant about system-level operations, I apologize.
> 
> Can you explain why this works better with writing to a file (i.e. the
> hardcoded location /var/log/nginx/*.log)?
> 
[..]

In most cases writing to a file never blocks.

Writing to stdout/stderr blocks as soon as buffers in kernel are getting full.
This may happen when consumer is slower than producer, or if the consumer is
just got stuck and don't read.

You can see users experience this issue:
https://github.com/docker/compose/issues/6018

So, nginx (like any other async application) must either log to a regular file
or an UDP socket.  Anything else is a bad idea from performance and reliability
points of view.

  wbr, Valentin V. Bartenev



More information about the nginx-devel mailing list