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.

Keep log files for month setting misleading

Discussion in 'General Discussion' started by MarlboroMan, Oct 6, 2006.

  1. MarlboroMan

    MarlboroMan Well-Known Member

    Dec 7, 2001
    Likes Received:
    Trophy Points:
    Noticed this on a couple of boxes. The one in this example is running 10.9.0-STABLE_38.

    Logs are being truncated daily. Traced it down to the "Keep log files at the end of the month (default is off as you can run out of disk space quickly)" setting in WHM, which controls "keeplogs" in the /var/cpanel/cpanel.config file.

    Looking at /usr/local/cpanel/cpanellogd, it appears that if keeplogs is not set, logs are truncated every time they are processed (every day, in this case), not kept for a month:

    (In dologs(), which is ran against each user every "cycle" days):

          if ( ! $CPCONF{'keeplogs'} ) {
             foreach my $log (keys %LOGS) {
                if (-f $log && $log !~ /^[\s\t\r\n]+$/) { resetfile($log); }
    sub resetfile {
       my $file = shift;
    Is this as intended? If so, the WHM setting is misleading, as it implies that if not checked, logs will be kept for a month, instead of truncated daily.

Share This Page