Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    107
    Likes Received:
    1
    Trophy Points:
    168
    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:
    261
    Likes Received:
    4
    Trophy Points:
    68
    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:
    107
    Likes Received:
    1
    Trophy Points:
    168
    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

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    261
    Likes Received:
    4
    Trophy Points:
    68
    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:
    107
    Likes Received:
    1
    Trophy Points:
    168
    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:
    261
    Likes Received:
    4
    Trophy Points:
    68
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice