The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom LogFormat

Discussion in 'General Discussion' started by grayloon, Oct 14, 2009.

  1. grayloon

    grayloon Well-Known Member

    Joined:
    Oct 31, 2007
    Messages:
    98
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    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>
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    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
     
Loading...

Share This Page