# Give it a solution for nginx to support cronolog like apache2

**URL:** <https://www.ruby-forum.com/t/give-it-a-solution-for-nginx-to-support-cronolog-like-apache2/229524>\
**Category:** NGINX\
**Created:** [January 24, 2013, 9:54pm UTC](https://www.ruby-forum.com/t/give-it-a-solution-for-nginx-to-support-cronolog-like-apache2/229524 "2013-01-24T21:54:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus\_SSSbionixS-i](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@Markus\_SSSbionixS-i](https://www.ruby-forum.com/u/Markus_SSSbionixS-i)\
**Post date:** [January 24, 2013, 9:54pm UTC](https://www.ruby-forum.com/t/give-it-a-solution-for-nginx-to-support-cronolog-like-apache2/229524/1 "2013-01-24T21:54:04Z")

</div>

Hello guys,

I’m looking for a good (maybe native) solution to use cronolog with  
nginx.  
I found only these two links [1]+[2], but I’m looking for a better  
solution like a module or a code upgrade.

Is a native solution in development or maybe give it a nginx patch?

Regards,

Markus “bionix”

[1] [http://pjkh.com/articles/nginx-and-cronolog/](http://pjkh.com/articles/nginx-and-cronolog/)  
[2] [https://gist.github.com/2891895](https://gist.github.com/2891895)

---

<div class="post-metadata">

**Author:** ![Markus\_SSSbionixS-i](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@Markus\_SSSbionixS-i](https://www.ruby-forum.com/u/Markus_SSSbionixS-i)\
**Post date:** [January 24, 2013, 10:13pm UTC](https://www.ruby-forum.com/t/give-it-a-solution-for-nginx-to-support-cronolog-like-apache2/229524/2 "2013-01-24T22:13:21Z")

</div>

On 01/24/2013 09:53 PM, Markus “bionix(-it)” wrote:

> Markus “bionix”
> 
> [1] [http://pjkh.com/articles/nginx-and-cronolog/](http://pjkh.com/articles/nginx-and-cronolog/)  
> [2] [nginx startup script with cronolog · GitHub](https://gist.github.com/2891895)

Well you could try make a log (error/access) format with  
vhost/domain/whatever there and setup single access\_log/error\_log  
location, which would be a fifo with cronolog cronolog connected to it,  
note that I have no idea whatever nginx can write to fifo (or will  
replace it with a file instead) but worth trying, to not slow down nginx  
because of the read-fifo flow you could use ftee (find ftee.c somewhere  
on the internet) and open fifo with it forwarding stdout to cronolog.

The above solution sounds like a overkill but if you want realtime  
cronolog…

– Piotr.

---

<div class="post-metadata">

**Author:** ![Markus\_SSSbionixS-i](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a698b9/32.png) [@Markus\_SSSbionixS-i](https://www.ruby-forum.com/u/Markus_SSSbionixS-i)\
**Post date:** [January 25, 2013, 4:30am UTC](https://www.ruby-forum.com/t/give-it-a-solution-for-nginx-to-support-cronolog-like-apache2/229524/3 "2013-01-25T04:30:16Z")

</div>

Maybe tengine is a solution. It can support pipe natively The  
documentation  
is here: [http://tengine.taobao.org/document/http\_log.html](http://tengine.taobao.org/document/http_log.html)

You can configure the cronolog ilke this:

error\_log “pipe:/path/to/sbin/cronolog  
/path/to/logs/%Y/%m/%Y-%m-%d-error\_log” warn;  
access\_log “pipe:/path/to/sbin/cronolog  
/path/to/logs/%Y/%m/%Y-%m-%d-access\_log” format;

2013/1/25 Piotr K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
