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.

Error Logs

Discussion in 'General Discussion' started by ben_b, May 16, 2004.

  1. ben_b

    ben_b Registered

    Joined:
    May 11, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Oregon
    How does one go about clearing the error log?
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    to do it manually, login as root:
    cd /etc/httpd/logs/
    rm error_log (or mv it or gzip it to a different file name)
    /etc/init.d/httpd stop
    /etc/init.d/httpd start

    (you have to stop and start httpd to create a new file)
     
  4. Stephanie_R

    Stephanie_R Active Member

    Joined:
    Mar 1, 2004
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Also:

    cat /dev/null > error_log

    Will empty the file leaving it in place.
     
  5. 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 do it that way, but you still must restart httpd otherwise the file space remains allocated on disk until you do.
     
  6. goodmove

    goodmove Well-Known Member

    Joined:
    May 12, 2003
    Messages:
    624
    Likes Received:
    0
    Trophy Points:
    16
    Does that apply to all log files (access, domain logs etc)?
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes. This is because Apache caches the inodes of the files and simply continues to access them. Deleting the file simply removes it from the directory file. You have to stop Apache so that on startup it sees that the file has gone and creates a new one. If you don't do this, the allocated space for the file that you "deleted" remains allocated on the partition and will infact continue to grow.
     
Loading...

Share This Page