Welcome! Log In Create A New Profile

Advanced

Re: How to make the log file printed by access_log split

July 25, 2013 05:40AM
Hi
There's no size limit, it will keep getting bigger until your disk is full
Here's a script I use to rotate the log, run it from cron every hour
hope it helps

#!/bin/sh
PID=`cat /usr/local/nginx/logs/nginx.pid`
LOG="/usr/local/nginx/logs/access.log"
NOW=$(date +"%Y-%m-%d-%H-%M")
NEWLOG="${LOG}.${NOW}
mv ${LOG} ${NEWLOG}
kill -USR1 ${PID}
gzip ${NEWLOG}


On 25/07/13 09:52, shawnxzhou wrote:
> what's the limit of the size of log file, and what will happen when it
> reaches the limitation?
> if I want to split the log file by timeline, say start a new file on the
> beginning of an hour, how can I configure ngnix?
>
> thanks
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,241226,241226#msg-241226
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to make the log file printed by access_log split

shawnxzhou July 25, 2013 04:52AM

Re: How to make the log file printed by access_log split

Maxim Dounin July 25, 2013 05:30AM

Re: How to make the log file printed by access_log split

dbradfield July 25, 2013 05:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready