The original version of nginx does not support write HTTP access log to pipe. It was not so flexible for managing logs with cronolog or scribe. The author of nginx (Igor Sysoev) said that the feature will not be in any future version of nginx. 

In 2011, The Taobao group in China just released their version of nginx, named Tengine. We take their patch, get the code corresponding to pipe only, and generate a patch file:  from Github

You can clone this Branch to compile, too.


access_log "pipe:/usr/local/bin/cronolog /data/logs/access-%Y-%m-%d.log" combined

Attention: if the piped program dead, log will be written to the default log file, not re-open the pipe just as Apache. If you use a unstable logger (e.g. log to network), setting another access log file is recommended to avoid the loss of access log. 

創作者 PIXNET Lab 的頭像


PIXNET Lab 發表在 痞客邦 留言(1) 人氣()

留言列表 (1)

  • cfsego
  • I am sorry to say your patch need update, 'cause I fix two bugs long long ago.