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.

logs problem

Discussion in 'General Discussion' started by abubin, Jul 27, 2005.

  1. abubin

    abubin Well-Known Member

    Joined:
    Dec 7, 2004
    Messages:
    393
    Likes Received:
    1
    Trophy Points:
    18
    I have setup custom logs in httpd.conf file which is used for urchin. That log is saved in "/usr/local/apache/logs/domain1". I have made logrotate to rotate these logs daily because this is a very busy site. The problem is, sometimes the log will stop running and the log file domain1_log will have zero size.

    I am suspect that logrotate ran and compressed domain1_log to domain1_log.1.gz. And then zero sized domain1_log. Then logs will stop running. I have to manually restart apache to make the logs start running again. Is there a way to overcome this?

    Thanks in advance.

    edit :

    This logrotate is stored in my logrotate.conf file :

    /usr/local/apache/logs/domain1/domain1_log {
    daily
    rotate 4
    }
     
    #1 abubin, Jul 27, 2005
    Last edited: Jul 27, 2005
  2. abubin

    abubin Well-Known Member

    Joined:
    Dec 7, 2004
    Messages:
    393
    Likes Received:
    1
    Trophy Points:
    18
    I have changed the logrotate.conf to this :

    Code:
    /usr/local/apache/logs/domain1/domain1_log {
        daily
        rotate 4
        missingok
        notifempty
        sharedscripts
        postrotate
            /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /d$
        endscript
    }
    
    You think this will work?
     
Loading...

Share This Page