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.

Rotating logs

Discussion in 'General Discussion' started by Soheil, Jun 1, 2004.

  1. Soheil

    Soheil Active Member

    Joined:
    Jun 24, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    Hello all,
    I have 3 questions on log rotation please:

    Question 1: I have been trying to figure out why my log files are not being rotated.
    Found a solution which suggested to create a file called apache and drop it in /etc/logrotate.d

    When I looked in /etc/logrotate.d i saw a file called apache.
    The contents are:
    Code:
    /var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log {
        missingok
        sharedscripts
        postrotate
            /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
        endscript
    }
    
    Problem:
    my log fiels are located in : /usr/local/apache/logs/

    Should I just change the path or should I add a new line for the correct path like:
    Code:
    /usr/local/apache/logs/access_log /usr/local/apache/logs/agent_log /usr/local/apache/logs/error_log /usr/local/apache/logs/referer_$
        missingok
        sharedscripts
        postrotate   
            /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
        endscript
    }
    


    Question 2:
    My users complain because they don't have an easy access to the log files to analize their programs, so I added a log file directory under the public_html and write the error.log and teh access.log to the files.
    Now the problem is that the domlogs get rotated automatically but these files keep growing.
    Can anyone tell me how I can rotate these logs?
    What I actually want to do is not keep a backup of these and just reset them to each week.

    Question3:
    Would keeping these extra logs effect the server performance? Like everytime the server has to write 2 log files. Would the effect be much to worry about?


    Thanks so much.
     
Loading...

Share This Page