Where is the script that re-opens the access log at the end of a stat run?

M0nKeY

Member
Jul 8, 2005
10
0
151
Hey,

I have nginx running on a cPanel server and I need to instruct it to reopen logs the same time Apache does. Where can I go to make this modification? Preferably in a way that won't be reset during a cPanel update.

Any help would be appreciated.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: Where is the script that re-opens the access log at the end of a stat r

Hello,

The log is not typically cleared when it is parsed as rotation occurs in /usr/local/apache/logs/access_log via logrotate rather than cpanellogd processes.

You could always check for Apache graceful restarts in /usr/local/apache/logs/error_log file as those are typically the times when processing occurs, but knowing what nginx is doing specifically that requires it reopening the logs at the exact same time, since the access_log isn't rotating normally anyway would be helpful. The domlogs do get rotated whenever they process in /usr/local/apache/logs/domlogs location for the domains, but those differ from the main Apache access_log file.

Thanks!
 

M0nKeY

Member
Jul 8, 2005
10
0
151
Re: Where is the script that re-opens the access log at the end of a stat r

Hey Tristan,

My nginx config writes to each domlog since that's what awstats processes. They are set to be deleted after a stat run becasue It is a high traffic server and keeping them for the month would require many gigs of space. The problem is that the logs are not deleted at the same time every day due to the way stats are processed so setting a cron would not work.

Sort of unrelated, but I'm using piped loging for apache so there technically aren't any restarts. Sadly nginx has no such option yet.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Re: Where is the script that re-opens the access log at the end of a stat r

So these are the domlogs rather than the access_log file right? It would be cpanellogd that handles processing the domlogs and those each process at different times as they process account by account.