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.

Log question

Discussion in 'General Discussion' started by Homie, Oct 30, 2004.

  1. Homie

    Homie Member

    Joined:
    Jul 22, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Hello People,

    I noticed that cPanel is not using logrotate to rotate http logs since the path in the httpd config file which is located under /etc/logrotate.d/ is euqal to /var/log/httpd.

    My question is this... which mechanism is cPanel using to rotate its Apache logs, and is it possible for me to configure it as I like?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Which Apache logs? IF you're refering to the site logs in /etc/httpd/domlogs, then they are rotated according to your settings in WHM > Tweak Settings for the rotation interval you choose based on the stats run frequency.

    If you're referring to the logs in /etc/httpd/logs/, then they aren't rotated. It's a well known omission on cPanels part which you certainly can fix yourself by using logrotate and fixing the apache file in /etc/logrotate.d/httpd to look like this:
    Code:
    /etc/httpd/logs/*log {
        missingok
        notifempty
        sharedscripts
        compress
        postrotate
            /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
        endscript
    }
     
  3. Homie

    Homie Member

    Joined:
    Jul 22, 2003
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Okay, I will rewrite my question with better examples, so there will be no doubt on what I am refering to.

    By default, on every cPanel based machine I have examined (3 in total) the httpd logrotate file looks like this:

    Now, the directory /var/log/httpd/ is not in use by cPanel. Only the directory /usr/local/apache/domlogs is being used by cPanel to contain site logs, every other directory is just a symlink to this one.

    My question is this: How come the logs under the domlogs directory get rotated every week, IF the httpd logrotate file on 3 of my machines is pointing to /var/log/httpd/. There is something else involved in this log rotation.

    Note: It has always been like, I just noticed it the other day, yet the logs do get rotate, but it doesn't seem like they get rotated by logrotate.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The cpanllogd stats processing daemon rotates them depending on your settings under:

    WHM > Tweak Settings > Number of days between processing log files and bandwidth usage
    WHM > Tweak Settings > Delete each domain's access logs after stats run
    WHM > Tweak Settings > Keep log files at the end of the month
    WHM > Tweak Settings > The load average above the number of cpus at which logs file processing should be suspended

    Each of those settings can affect when the individual site logs are rotated in domlogs by cpanellogd.
     
  5. KaTXi

    KaTXi Member

    Joined:
    Dec 2, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I'd like to delete domain logs after each day process BUT i'd like to keep a backup of that daily domlogs before the delete.
    Right now i'm using my own script to do that (I haven't found an option about this on WHM). Is there any way to do it with WHM / CPANEL ?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    AFAIK, no. You either have them deleted after the stats log run, or at the end of the month. There're no options to have them backed up by the stats log run before they're wiped.
     
  7. meganet

    meganet Well-Known Member

    Joined:
    Mar 28, 2005
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    So,

    Code:
    Number of days between processing log files and bandwidth usage (default 1, decimal values are ok):
    is value in days that each domains apache domain access logs is kept? This is what affects the raw log option that users have?

    right now I'm seeing domains having logs only a day old, I'm assuming if I set this option to 7, they will have domain access lgos for a week to download?
     
  8. dev_cw

    dev_cw Well-Known Member

    Joined:
    Jun 30, 2004
    Messages:
    59
    Likes Received:
    1
    Trophy Points:
    8
    Does logrotate still need to be tweaked to rotate the logs in /etc/httpd/logs/ or has cPanel resolved this issue?

    My last server I setup ( years ago) needed these tweaks. I am setting up a new server and was wondering if these problems still exist in 2006 (almost 2007). :confused:
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    They still haven't fixed it. You still need to add the rotation yourself.
     
  10. Secmas

    Secmas Well-Known Member

    Joined:
    Feb 18, 2005
    Messages:
    321
    Likes Received:
    0
    Trophy Points:
    16
    Hi all,
    just wondering... what are the best options to set on WHM for DOMLOGS rotations?

    TIA.

    Regards,
    Sergio
     
  11. asiams

    asiams Well-Known Member

    Joined:
    May 28, 2003
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Hokkaido, JAPAN
    Daily raw logs to customers?

    Is there any way to put daily log to a customer's home/ directory?

    So that my customer can view them from his/her log analizing software?

    This only involves in copying daily access log to one's home/ directory without changing any setting.

    Any idea?

    Thanks.
     
  12. phuner

    phuner Member

    Joined:
    Feb 8, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    They still didn't fixed that thing ... LOL
     
  13. xano

    xano Registered

    Joined:
    May 22, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Daily Access logs

    Does anyone know the answer to this question?
     
Loading...

Share This Page