<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi there,<br>
<br>
Unfortunately nginx doesn't support piping log method inside it's
config script, so you have to set it separately.<br>
try this:<br>
<br>
~ point your access/error log to a file, such as <i>logs/access.log</i>
and <i>logs/error.log</i><br>
~ if <i>logs/access.log</i> and <i>logs/error.log</i> has been exist,
delete them, and recreate as fifo's<br>
~ <i>mkfifo logs/access.log logs/error.log</i><br>
~ make a .sh files to put a cronolog script and piping, like:<br>
<br>
#!/bin/bash<br>
<pre><code>(cat /usr/local/nginx/logs/access.log |/usr/local/sbin/cronolog -l /var/log/nginx/access.log \
/var/log/nginx/%Y/%m/%d/%H/access.log) &
(cat /usr/local/nginx/logs/error.log |/usr/local/sbin/cronolog -l /var/log/nginx/error.log \
/var/log/nginx/%Y/%m/%d/%H/error.log) &</code></pre>
~ start/execute thus file whenever you start your nginx<br>
<br>
<small><small>Source and references:<br>
<a class="moz-txt-link-freetext" href="http://pjkh.com/articles/nginx-chronolog.html">http://pjkh.com/articles/nginx-chronolog.html</a></small></small><br>
<br>
<small><small>rgrds,</small></small><br>
Andika<br>
<b><small>INDONESIAN</small></b><br>
<br>
Corey Donohoe wrote:
<blockquote
cite="mid:c75e5f320803122109s4a44a764q5b1a2a5b6a1e61dd@mail.gmail.com"
type="cite">
<pre wrap="">We use that logrotate config on like 1500+ linux instances. It
works... really. I too have been burned by various things wrt log
rotation, but nginx shows nothing but love. ;)
On 3/12/08, Dave Cheney <a class="moz-txt-link-rfc2396E" href="mailto:dave@cheney.net"><dave@cheney.net></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Meh - i've had logrotate screw up on my too many times and delete a
log file that things are logging into.
On 13/03/2008, at 2:46 PM, Corey Donohoe wrote:
> Yo,
>
> We do something like this at Engine Yard.
>
> Daily nginx logrotation during non-peak hours:
>
> <a class="moz-txt-link-freetext" href="http://pastebin.com/f400c3e0e">http://pastebin.com/f400c3e0e</a>
>
> Daily log migration to a drive with more space:
>
> <a class="moz-txt-link-freetext" href="http://pastebin.com/f6bc64e94">http://pastebin.com/f6bc64e94</a>
>
> On 3/12/08, Dave Cheney <a class="moz-txt-link-rfc2396E" href="mailto:dave@cheney.net"><dave@cheney.net></a> wrote:
>> Try something like this
>>
>
>
> --
> Corey Donohoe
> <a class="moz-txt-link-freetext" href="http://www.atmos.org/">http://www.atmos.org/</a>
> <a class="moz-txt-link-freetext" href="http://www.engineyard.com/">http://www.engineyard.com/</a>
>
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>