In this tutorial, I will show you how to download your website’s raw access logs from cPanel and extract to view them. We’ll talk about archiving the logs and how long to keep archives.
The resulting lists of all of the requests are called “raw logs” or “access logs.”
The raw logs are text files with one line for each request:
That’s what they call a solid block of text. But it’s also full of information.
Most of us interpret the logs using a stats program like Webalizer or AWStats. But the raw logs can be useful for finding abuse patterns and a myriad of other information that a stats program doesn’t provide.
cPanel makes downloading the raw logs easy.
Finding Your Website’s Raw Access Logs in cPanel
Click the “Raw Access” link or icon
In the “Configure Logs” section, there are two options:
- Archive log files to your home directory after the system processes statistics.
- Remove the previous month’s archived logs from your home directory at the end of each month.
Both options may already be selected by default. If that’s the case, you can download logs immediately. If the “Archive log files” option is not selected, check the box and click the “Save” button.
The system processes access logs every 24 hours. So if you had to activate log archiving, you will have to wait at least 24 hours to download the raw logs.
Downloading Raw Access Logs
If log archiving was already selected, you can download your access logs right away.
In the “Download Current Raw Access Logs” section, click the domain name to download the raw logs for that domain.
Once extracted, you can open the file in any text editor.
Downloading Archived Raw Logs
You can download access logs from the archive in the same way.
Click the name of the archive you’d like to download. Unzip and open in your text editor.
How Long Should Logs Be Retained?
In the “Configure Logs” section, you have the option to “Remove the previous month’s archived logs from your home directory at the end of each month.” If you check this option, the system will archive raw logs for a month.
If you need to keep more than one month of raw logs, uncheck the option and click the “Save” button.
Use caution. If you run a busy site, the raw access logs can become quite large. The system saves logs in your home directory. So in many cases, the size of the logs will count against your website storage space quota.
If you do choose to retain logs, be sure to keep an eye on the amount of space they use and delete as necessary.
Have you ever taken a look at your raw logs? If you retain logs, how many months do you typically keep?