MadPopo Best WordPress Hosting Solution

Need Help ?  Call Us 24/7 : +91 7039 003 001

How to Download Raw Access Logs In cPanel

In this guide, I’ll demonstrate how to download your website’s raw access logs from cPanel and extract them for viewing. We’ll also discuss archiving the logs and determining how long to retain them.

Web servers typically maintain a log of requests for resources such as pages, images, JavaScript, and CSS. Whenever a visitor requests a file, the server records details such as the visitor’s IP address and the requested file, among other information.

These lists of requests are known as “raw logs” or “access logs.” They are text files containing one line for each request.

That’s quite a dense paragraph, packed with information.

Typically, we analyze these logs using statistical programs like Webalizer or AWStats. However, raw logs offer additional insights, such as detecting abuse patterns, that may not be available in these programs.

Downloading the raw logs is straightforward with cPanel.

Finding Your Website’s Raw Access Logs in cPanel

Click the “Raw Access” link or icon

In the “Configure Logs” section, you’ll find two options:

  1. Archive log files to your home directory after the system processes statistics.
  2. Remove the previous month’s archived logs from your home directory at the end of each month.

These options may already be selected by default. If so, you can download the logs immediately. If the “Archive log files” option is not selected, check the box and click the “Save” button.

The system processes access logs once every 24 hours. Therefore, if you’ve just activated log archiving, you’ll need to wait at least 24 hours before you can download the raw logs.

Downloading Raw Access Logs

If you had already selected log archiving, you can download your access logs immediately.

Navigate to the “Download Current Raw Access Logs” section and click on the domain name to download the raw logs for that specific domain.

The logs are zipped as .gz archives so you will need an unzipping program such as 7-Zip or WinZip to extract the log file.

Once extracted, you can open the file in any text editor.
The logs are compressed as .gz archives, so you’ll need an unzipping program like 7-Zip or WinZip to extract the log file.

After extraction, you can open the file in any text editor.

Downloading Archived Raw Logs

You can download access logs from the archive using the same method.

Click on the name of the archive you want to download, then unzip and open it in your text editor.

How Long Should Logs Be Retained?

In the “Configure Logs” section, you can choose to “Remove the previous month’s archived logs from your home directory at the end of each month.” Selecting this option will archive raw logs for one month only.

If you wish to retain raw logs for longer than a month, deselect this option and then click the “Save” button.

Please be cautious: for busy websites, raw access logs can grow to be quite large. These logs are saved in your home directory and often count against your website’s storage space quota.

If you decide to retain logs, monitor their size regularly and delete them when necessary.

Have you ever examined your raw logs? If you keep logs, how many months’ worth do you usually retain?

Sanyog Shelar

passionate about programming and system architecture design, and he uses his deep knowledge to help clients achieve their goals. He also shares his expertise on various cybersecurity issues and offers practical advice on how to protect against common threats. In addition to his technical skills, Sanyog is an expert in server management and is able to provide expert advice on how to manage web applications at the server level.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.