clean nginx log

Igor Sysoev igor at sysoev.ru
Wed May 25 09:38:17 MSD 2011


On Wed, May 25, 2011 at 01:10:54PM +0800, Jeff Pang wrote:
> Hello,
> 
> I'm not sure, is it just right to truncate the nginx's access log by:
> 
> echo -n > /path/to/log/access.log

nginx uses O_APPEND flag for access log, so this trick may work.
There is however, a more safer way:

rm access.log
kill -USR1 `cat /path/to/nginx.pid`


-- 
Igor Sysoev



More information about the nginx mailing list