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.

Tail log files

Discussion in 'General Discussion' started by NightStorm, May 8, 2006.

  1. NightStorm

    NightStorm Well-Known Member

    Joined:
    Jul 28, 2003
    Messages:
    286
    Likes Received:
    4
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    A program that I am working with needs to be able to tail -f the Apache log files on the fly for all my domains.
    tail -f /usr/local/apache/domlogs/* won't work though, because CPanel is putting all the other logs in that folder as well, which I don't want... only the main domain http log.
    Anyone got an idea on how I can sort this out to only parse the proper logs while skipping over the extra crap in there, like the <domain>-bytes_log and <domain>-bytes_log.offset and <domain>-smtpbytes_log files?
     
  2. RickG

    RickG Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    238
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    North Carolina
    Take a look at the CustomLog directive under each of the VirtualHost containers in /usr/local/apache/conf/httpd.conf

    By default, the value is:
    CustomLog domlogs/domainname.com combined

    One option would be to change the existing directive to something like:
    CustomLog domlogs/domainname.com.log combined

    Or ... add an additional CustomLog directive to each VirtualHost container pointing and naming the secondary log to whatever you want. If you do this, just keep a watch on resources etc.
     
Loading...

Share This Page