Last active
June 24, 2020 17:19
-
-
Save Ferrisx4/eef08e632397a8288b319ec15bfdbcb4 to your computer and use it in GitHub Desktop.
Clean Apache Access Log format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In httpd.conf | |
<IfModule log_config_module> | |
# Define the format | |
LogFormat "%{%H:%M:%S}t %>s %b \t%r" custom_ferris | |
# later... | |
# Tell Apache to write a lot somewhere and specify the format (defined earlier) | |
CustomLog "/private/var/log/apache2/access_log" custom_ferris | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This config creates a nice Apache access log (easily readable) with the columns most likely to always be the same width on the left (timestamp, response code, size), followed by the request (including method) at the end.
Read more at the mod_log_config page.
The goal is to make it easier to read/watch by a human. The default log format includes the response code (200, 404, etc) buried within the request, which is all over the place.
Example: