grayloon

Well-Known Member
Oct 31, 2007
117
4
68
Evansville, IN
cPanel Access Level
Root Administrator
Twitter
I created a custom LogFormat in my httpd.conf file. I want all my virtual hosts to use this format. Is there any easy way to do this and make it stick after subsequent EasyApache builds?

Code:
<IfModule mod_log_config.c>
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %v %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" urchin

    CustomLog logs/access_log common

</IfModule>
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
It is possible to retain a modified CustomLog format using the Apache configuration distiller and then rebuilding the httpd.conf file; I recommend thoroughly reviewing the following documentation pages for more details and step-by-step instructions:

Parent EasyApache3 (EA3) section:
Apache & cPanel/WHM

Introduction to how httpd.conf is processed by EasyApache:
EA3Overview < EasyApache3 < TWiki

Details for saving customizations outside of virtual host directives (such as the CustomLog format):
OutsideVHost < EasyApache3 < TWiki

Section detailing how to save additional configuration entries not retained by the distiller (via include files):
SavingCustomOptions < EasyApache3 < TWiki