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.

View apache logs in real time?

Discussion in 'EasyApache' started by vikins, Apr 11, 2013.

  1. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    91
    Likes Received:
    1
    Trophy Points:
    8
    Is there a way to grab the log output from apache that the new splitlogs feature is using for the purposes of grepping it in realtime? Since there is no single file storing all the logs for all of the hosted domains you can't use something like "tail -f" either. Thanks!
     
  2. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    It depends on what you are trying to see. If your looking to see some better apache server status , then you could try the following:
    Code:
    
    links --dump 1 http://localhost:80/whm-server-status|grep ^[0-9]|awk 'BEGIN {print "Seconds, PID, State, IP, Domain, TYPE, URL\n--"} $4 !~ /[GCRK_.]/ {print $6, $2, $4, $11, $12, $13 " " $14|"sort -n"}'
    
     
  3. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    91
    Likes Received:
    1
    Trophy Points:
    8
    Thanks, but got the following:
    -bash: links: command not found

    I am really looking for the raw log entries so that I can grep them in real time.

    Thanks again.
     
  4. prajithp13

    prajithp13 Member

    Joined:
    Jun 12, 2012
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    hey
    install links command using yum and try the above command

     
  5. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    If i understood this properly , and you are looking to grep all logs , then you may try the following:
    Code:
    egrep -R "search string" /usr/local/apache/logs/{access_log,error_log} /usr/local/apache/domlogs/*
     
  6. vikins

    vikins Well-Known Member

    Joined:
    Oct 3, 2006
    Messages:
    91
    Likes Received:
    1
    Trophy Points:
    8
    Thank you, but I am looking for something that will show realtime, streaming output as if all the logs entries were being written to a single file and I was doing a tail -f on that file.
     
  7. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    Maybe something like this then:
    Code:
    ls /usr/local/apache/logs/{access_log,error_log} /usr/local/apache/domlogs/*|xargs tail -f
    
     
Loading...

Share This Page