我正在研究一个高容量的Apache prefork站点,并注意到许多日志条目,例如:
CustomLog '|/foo/bar/cronolog -foo -bar' RewriteLog '|/foo/bar/cronolog -bar -foo'
当apachelogging请求,或者重写是cronolog 为每个请求产生的,或者是在preforked apache进程的生存期内打开和写入的pipe道?
(这是问stackoverflow,但我会从那里删除更适用于我认为。)
它是每个CustomLog指令产生的。
因此,在我的服务器上,我在全局范围内使用这两个指令,只有cronolog的一个副本开始用于写入日志。
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhost CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y%m.combined.allhosts.log" combinedvhost