I'm trying to find - and modify - the "combined" log format Apache uses. And any other log-related settings, really.
My /etc/apache2/conf/httpd.conf file has the following log format directive:
This section seems to be properly produced by the ea4_main.default template, nothing strange about it. But, my /usr/local/apache/domlogs/domain.com log file is formatted differently:
It clearly isn't using the format which starts with "%v:%p", a hostname and a port.
Then, my cpanel/userdata/username/domain.com file has the following lines:
This seems to indicate the "combined" format for the domain.com log, but as shown above, "combined" must've been overridden... somewhere. Also, I find no trace of the domlogs/domain.com file compiled into httpd.conf anywhere that I could find. Not in httpd.conf, not in any virtualhost includes (I have some custom includes, but they're not created with a template).
So - where does Apache get the log formats, and how do I modify them? Or, more widely: how EXACTLY are the Apache configuration files built? So far I was sure it's cpanel/templates + cpanel/userdata = httpd.conf, but apparently there's more to it.
My curiosity is also piqued by some httpd.conf.work.QiHpbC20 files in /etc/apache2/conf, there ARE domain.com-related entries in them, but they aren't actively used, now are they?
My /etc/apache2/conf/httpd.conf file has the following log format directive:
Code:
<IfModule mod_log_config.c>
...
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
</IfModule>
Code:
209.299.199.299 - - [25/Nov/2018:03:10:04 -0500] "GET /url/somefile" 200 - "-" "UserAgent"
Then, my cpanel/userdata/username/domain.com file has the following lines:
Code:
customlog:
-
format: "\"%{%s}t %I .\\n%{%s}t %O .\""
target: /usr/local/apache/domlogs/domain.com-bytes_log
-
format: combined
target: /usr/local/apache/domlogs/domain.com
So - where does Apache get the log formats, and how do I modify them? Or, more widely: how EXACTLY are the Apache configuration files built? So far I was sure it's cpanel/templates + cpanel/userdata = httpd.conf, but apparently there's more to it.
My curiosity is also piqued by some httpd.conf.work.QiHpbC20 files in /etc/apache2/conf, there ARE domain.com-related entries in them, but they aren't actively used, now are they?
Last edited: