The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by M0nKeY, Jun 6, 2012.

  1. M0nKeY

    M0nKeY Member

    Joined:
    Jul 8, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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!
     
  3. M0nKeY

    M0nKeY Member

    Joined:
    Jul 8, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
Loading...

Share This Page