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!

Logs for specific date

Discussion in 'General Discussion' started by thewebhosting, Oct 22, 2009.

  1. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    68
    How to check apache error logs for a specific date for the specific domain?

    When I do cat error_logs | grep username I got a list of error logs for that domain but it displays all the dates. I want to know the command to check logs for a particular date?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,544
    Likes Received:
    9
    Trophy Points:
    268
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Using grep, it is possible to narrow the output to a specific date using an example like the following:
    Code:
    # grep "Oct 20" /usr/local/apache/logs/error_log
    I would also consider opening the error_log in a text viewer such as "less" -- this method will allow the file to be easily scrolled through; when opened in "less" you may enter a search string by pressing the forward slash key "/" on the keyboard.
    Code:
    # man less
    # less /usr/local/apache/logs/error_log
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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