Can't get Apache to NOT log items in access.log

Discussion in 'Server Operation' started by corepuncher, Sep 10, 2014.

  1. corepuncher

    corepuncher New Member

    I tried to follow this tutorial:

    http://www.howtoforge.com/setenvif_apache2

    It does not seem to be working, need help.

    Here is an example of items I want to filter out of access.log:

    x.x.x.x - - [06/Sep/2014:15:02:35 -0500] "HEAD /dir/dir2/file1/file2.gif HTTP/1.1" 200 224 "-" "-"

    127.0.0.1 - - [06/Sep/2014:15:02:30 -0500] "GET /foo1/foo2.php? HTTP/1.0" 200 28956 "-" "Wget/1.12 (linux-gnu)"


    The tutorial didn't specify where to put the SetEnvIF, so I put it in two locations:

    apache2.conf and /sites-available/default:

    SetEnvIf Request_URI "HEAD /dir/" dontlog
    SetEnvIf Request_Addr "127\.0\.0\.1" dontlog
    SetEnvIf Request_Addr "::1" dontlog


    And added env=!dontlog to the existing sites-available/default CustomLog entry:

    CustomLog ${APACHE_LOG_DIR}/access.log combined env=!dontlog

    I then assume this restarted Apache: apachectl graceful

    Logs continue to fill with the items I tried to filter out...any ideas? Thanks.
     

Share This Page