Understanding Server Logs
Understanding Server Logs
Server logs are invaluable for troubleshooting website issues, monitoring traffic, and identifying security threats. Your hosting account generates two main types of logs: access logs and error logs.
Types of Server Logs
Access Logs
Access logs record every request made to your website, including:
- Visitor IP address
- Date and time of the request
- HTTP method and URL requested
- HTTP status code returned
- User agent (browser/bot identification)
- Referring URL
Example access log entry:
192.168.1.1 - - [07/Mar/2026:10:15:30 -0500] "GET /index.html HTTP/1.1" 200 5432 "https://google.com" "Mozilla/5.0..."
Error Logs
Error logs record server-side errors, including:
- PHP errors (fatal, warning, notice)
- File permission issues
- Missing files (404 errors)
- Configuration problems
- Application crashes
Example error log entry:
[Fri Mar 07 10:15:30.123456 2026] [php:error] [pid 12345] [client 192.168.1.1:54321] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
Accessing Logs in cPanel
Error Log (Quick View):
- Log into cPanel.
- Go to Metrics > Errors.
- View the most recent 300 error entries.
Raw Access Logs:
- Go to Metrics > Raw Access.
- Download compressed log files for each domain.
Error Log File:
- Location:
/home/username/logs/error.logor checkpublic_html/error_log - Access via File Manager or SSH
Access Log File:
- Location:
/home/username/logs/access.log(or similar path) - Access via File Manager or SSH
Reading Log Entries
Common HTTP Status Codes in Logs:
| Code | Meaning | Action |
|---|---|---|
| 200 | OK — Successful | Normal, no action needed |
| 301 | Moved Permanently | Check redirects are working |
| 304 | Not Modified | Normal — browser caching working |
| 403 | Forbidden | Check file permissions |
| 404 | Not Found | Fix broken links or missing files |
| 500 | Internal Server Error | Check error log for details |
| 503 | Service Unavailable | Server overloaded or maintenance |
Using Logs for Troubleshooting
Finding PHP errors:
grep "PHP" /home/username/logs/error.log | tail -20
Finding 404 errors:
grep " 404 " /home/username/logs/access.log | tail -20
Checking for suspicious activity:
grep "wp-login" /home/username/logs/access.log | awk '{print $1}' | sort | uniq -c | sort -rn | head -10
Monitoring logs in real-time via SSH:
tail -f /home/username/logs/error.log
Log Management Tips
- Check error logs first when troubleshooting any website issue.
- Rotate logs regularly to prevent them from consuming excessive disk space.
- Archive old logs for compliance or analysis purposes.
- Use log analysis tools like AWStats or Webalizer (available in cPanel under Metrics) for visual reports.
- Monitor for brute-force attacks by checking repeated failed login attempts.
Privacy Considerations
Server logs contain visitor IP addresses and are subject to privacy regulations like GDPR. Ensure your privacy policy discloses log collection, and consider implementing log anonymization if required.
For help interpreting server logs, contact 10Corp support.