8、旋转日志文件-阅读官方文档

官网: Controlling nginx

翻译部分:Rotating Log-files

开始!


In order to rotate log files, they need to be renamed first.

 为了旋转日志文件,需要首先重命名它们。


After that USR1 signal should be sent to the master process.

 之后,USR1信号应发送至主进程。


The master process will then re-open all currently open log files and assign them an unprivileged user under which the worker processes are running, as an owner.

然后,主进程将重新打开所有当前打开的日志文件,并为它们分配一个工作进程运行时所使用的非特权用户作为所有者。 


After successful re-opening, the master process closes all open files and sends the message to worker process to ask them to re-open files.

 成功重新打开后,主进程关闭所有打开的文件,并将消息发送给工作进程,要求它们重新打开文件。


Worker processes also open new files and close old files right away.

 工作进程也立即打开新文件和关闭旧文件。


As a result, old files are almost immediately available for post processing, such as compression.

 因此,旧文件几乎可以立即用于post处理,如压缩。

你可能感兴趣的:(nginx)