Quick tip that I want to keep for future reference: where/how to download the error logs for a site in Plesk. Normally in Plesk, to view a site’s error (and access) logs, you visit the Logs screen and select whichever logs, which then are displayed within the web page. So you can view all the log information within the Plesk UI. In general, the log viewer in Plesk works great and is configurable, etc.
Dealing with large log files
The only issue that I sometimes run into, is that only 500 lines of the log are displayed at a time. So if you want to “zoom out” for a wider view, it can take a lot of extra time, clicking the “Load previous entries” button over and over to keep loading the next 500 log entries.. it can be a pain. Likewise if you just need to view the oldest entries in the log file. For very large logs, it can take forever clicking “Load previous entries” until the cows come home.
Sometimes you just gotta download
As someone who is constantly digging through site logs, the Plesk “Logs” interface can really slow things down and get a little tedious if not downright frustrating. So, awhile back, I took a few moments to figure out how and where to download log files directly to my local machine, in the form of plain text files that can be opened in any decent text editor.
Download Log Files Directly
So the punchline: You can download any site’s access and error logs directly from the server, via the following paths:
/var/log/httpd/access_log
/var/log/httpd/error_log
You can connect to (S)FTP client Application (such as FileZilla) as root login and download either/both of these files to your local machine.
Other Error Logs
In addition to the main error log, error_log
, it is common for servers to host multiple logs, archived by date. Here are some examples to give you an idea:
/var/log/httpd/error_log
/var/log/httpd/error_log-20240901
/var/log/httpd/error_log-20240811
/var/log/httpd/error_log-20240818
/var/log/httpd/error_log-20240825
.
.
.
Also: ssl_error_log et al
Similar archived files probably exist for access logs as well.
Even more locations..
Yes there are more places to find log files. Here are some examples:
/var/log/sw-cp-server/error_log
/var/log/sw-cp-server/sw-engine.log
/var/log/sw-cp-server/error_log-20240811.gz
/var/log/sw-cp-server/error_log-20240818.gz
/var/log/sw-cp-server/error_log-20240825.gz
/var/log/sw-cp-server/sw-engine.log-20240707.gz
/var/log/sw-cp-server/sw-engine.log-20240727.gz
/var/log/sw-cp-server/access.log-20201227.gz
/var/log/sw-cp-server/access.log-20210115.gz
And even more: each site on the server has its own set of log files, for example:
/var/www/vhosts/example.com/logs/error_log.1.gz
/var/www/vhosts/example.com/logs/error_log.2.gz
/var/www/vhosts/example.com/logs/error_log.3.gz
/var/www/vhosts/example.com/logs/error_log.4.gz
/var/www/vhosts/example.com/logs/error_log.5.gz
/var/www/vhosts/example.com/logs/error_log.6.gz
/var/www/vhosts/example.com/logs/error_log.7.gz
.
.
.
The numbers correspond to the site’s “Log Rotation” settings.