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.

Check Apache and FTP logs for specific date

Discussion in 'EasyApache' started by nana_coinwale, Apr 2, 2010.

  1. nana_coinwale

    nana_coinwale Member

    Joined:
    Nov 15, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Is there any way we can check apache and FTP logs for specific date?

    I tried,

    grep "Mar 25" /usr/local/apache/logs/error_log | grep domain name

    grep "Thu Mar 25" /usr/local/apache/logs/error_log | grep domain name

    with no luck. Please assist me if any one knows a proper way.

    Thank you in advance :)
     
  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:
    For FTP logs, check the system messages log, typically at the following path:
    Code:
    /var/log/messages
    The following command will also attempt to search rotated copies of the system messages log while allowing for compression in either gzip or bzip2:
    Code:
    # zgrep -Hin "example" /var/log/messages*
    # bzgrep -Hin "example" /var/log/messages*
    Errors logged by Apache will be found in the same path that you noted:
    Code:
    /usr/local/apache/logs/error_log
    Potentially related details may be logged in other files, such as from the Apache modules suEXEC or suPHP:
    Code:
    # grep -Hin "example" /usr/local/apache/logs/*log
    With regard to the Apache error_log, it can be difficult to track down older messages because the domain name may not be explicitly logged; however, you may also try searching by the cPanel account username, as this is sometimes referenced in an error even if the domain name is not mentioned.

    Please note that there may be a different date and time format used in different log files, so you would need to briefly examine each log file to ascertain the unique date and time format needed when using grep. A text viewer such as "less" or "more" or editors such as vi/vim or nano/pico may be used to view a file; here are a few examples to open a file in read-only mode:
    Code:
    # less /path/to/file
    # vim -R /path/to/file
    # nano -v /path/to/file
    To have line numbers and syntax-highlighting, I suggest the following example using "vim" (to view a file such as the system messages log):
    Code:
    # vim -c "set number" -R /var/log/messages
     
Loading...

Share This Page