How to configure nginx to store access logs by minute?

user1361315 asked:

Is it possible to configure nginx to create a new access log for a given host per minute?

An external process/application will be reading from these log files, and I want to make sure there are no file locking issues etc., so if I can have nginx create a new log file every minute, this way I can make sure I don’t touch the current minutes log file.

My answer:


Just going to quote from the developer here:

If you really want logging to an external process – try using mkfifo(1), but please keep in mind that this will lead to service interruption if your logging process won’t be able to cope with load. I would recommend logging to a normal file and using “tail -F /path/to/log | script” instead if you need some log processing.

See also: Proper way to rotate Nginx logs


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.