Access & Error Logs in Apache
From the Apache cheat sheet ยท Logging ยท verified Jul 2026
Access & Error Logs
Configure log files, formats, and rotation
apacheconf
# Error log
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
# Access log with combined format
CustomLog ${APACHE_LOG_DIR}/access.log combined๐ก Use combined format for access logs โ it includes Referer and User-Agent for analysis
โก Set LogLevel rewrite:trace3 to debug mod_rewrite rules โ essential when rules don't work
๐ Use SetEnvIf to exclude health checks and bots from access logs โ keeps logs clean
๐ข Pipe logs to rotatelogs for automatic rotation without logrotate config
loggingaccess-logerror-log