
Originally Posted by
nana_coinwale
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

For FTP logs, check the system messages log, typically at the following path:
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