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.

DomLog rotation?

Discussion in 'General Discussion' started by Ronny, Oct 11, 2004.

  1. Ronny

    Ronny Well-Known Member

    Joined:
    Dec 27, 2002
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Is that possible without manually writing a script? It seems a big problem on many servesr. PLESK has it's own log rotation system. Several domains always end up breaking apache due to their 2gb log file sizes.
     
  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
    You can set the logs to rotate after every stats run, which then only keeps the records since the last stats run: WHM > Tweak Settings > Delete each domain's access logs after stats run
     
  3. Jeff-C

    Jeff-C Well-Known Member

    Joined:
    Mar 16, 2004
    Messages:
    117
    Likes Received:
    0
    Trophy Points:
    16
    I have one domain on the server that is passing the 2GB filesize limit for its domlog around the 20th of each month.

    But I'd like to keep the raw logs for more than 24 hours in case I need to refer to them.

    Are there any easy ways to:
    1.) only delete/reset the domlogs when they pass say 1.5 GB in size
    2.) rotate the domlogs on a weekly basis to something like domain.ext.2 domain.ext.3 and domain.ext.4

    Or some other way to keep the log files for more than 24 hours and yet still keep them from growing beyond 2 GB?
     
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    you could set logrotate /etc/logrotate.conf instead of cpanel doing it

    to rotate your domain logs for you then you would have your domain.com domain.com.1 domain.com.2 etc


    I use logrotate to rotate my domain SSL logs


    works just fine
     
  5. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    If you use logrotate cpanel may miss some of the information as it may be removed before the stats program gets a chance to get at it. Alternatively, you could have the logs rotate on each run and have the users save their log files via cpanel. Otherwise, put in a feature request ( enhancement ) via bugzilla.cpanel.net to allow for "on demand" and "X days till rotate".
     
  6. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    its allready there use the logschedule in add on modules and any losses would be negligible

    but I agree this needs to be a feature enhancemet to combat large log files
     
    #6 dalem, Feb 27, 2005
    Last edited: Feb 27, 2005
  7. Jeff-C

    Jeff-C Well-Known Member

    Joined:
    Mar 16, 2004
    Messages:
    117
    Likes Received:
    0
    Trophy Points:
    16
    I just installed log schedule from the cpanel addons section, but it doesn't seem to have anything to do with log rotation. It gives me a choice of which times I do not want logs to be processed - but it doesn't seem to deal at all with the actual rotation of the log files???
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yup there's confusion with some people here between logrotate (an OS application that rotates server logs) and logrunner (the application that cPanel uses to rotate domlogs). They're different things. Logrotate does not rotate your domlogs. Logshcedule is an addon for affecting when logrunner runs. However, the OP is talking about logrotate.

    Without seeing what logrotate is doing on the server it's difficult to know where the problem lies. You could try running it interactively and see if it is balking on a certain log file:

    /usr/sbin/logrotate -vf /etc/logrotate.conf
     
  9. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    At the risk of asking a stupid question...

    Let's say I turn this option (above) on so that domain access logs are deleted after a stats run. The upside is of course that we have much smaller domlog sizes. But what are the downsides? What are the negative or side effects of doing this? What does it change as far as your average cPanel-using customer is concerned? Realistically, to what extent does it diminish the ability of a server administrator to do his/her job effectively?

    Thanks for your comments.
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
  11. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    thanks for that chirpy. I did search first - honestly! Maybe vbulletin and others could work on a more sophisticated built-in search engine for their forums in order based on more accurate relevancy scores! :)
     
  12. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page