troubleshooting Question

dontlog Apache 2.4

Avatar of projects
projects asked on
Apache Web ServerLinuxWeb Servers
2 Comments1 Solution295 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
Anthony Garcia
Devops Staff

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros