Avatar of projects
projects
 asked on

dontlog Apache 2.4

Looking all over the net, cannot find a solution that works. What's wrong with the following as it doesn't prevent the logging I am trying to stop.

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
        LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
        SetEnvIf Remote_Addr "::1" dontlog
        SetEnvIf Remote_Addr "1\.2\.3\.4" dontlog
        SetEnvIf Remote_Addr "5\.6\.7\.8" dontlog
        SetEnvIf User-Agent ".*internal dummy connection.*" dontlog
        CustomLog /var/log/httpd/access_log combined env=!dontlog
        CustomLog /var/log/httpd/access_log combined
        ErrorLog  /var/log/httpd/error_log
    <IfModule logio_module>
        LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
        CustomLog "logs/access_log" combined
</IfModule>

Open in new window

Apache Web ServerLinuxWeb Servers

Avatar of undefined
Last Comment
projects

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Anthony Garcia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
projects

ASKER
>CustomLog statement twice

Ooops, that was a typo, left in there from the last edit.
Edited and working now, thanks for catching that. Sometimes you stare at something too long and you don't see the obvious.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy