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.

Usage:

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 發表在 痞客邦 PIXNET 留言(1) 人氣()

留言列表 (1)

發表留言
  • cfsego
  • I am sorry to say your patch need update, 'cause I fix two bugs long long ago.
找更多相關文章與討論