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.

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:
    38
    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?
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    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
     
Loading...

Share This Page