Apache logfiles

conditional logging

To exclude something not to be logged in your apache access (or error) log can be achieved like so:

SetEnvIf Request_URI "^/favicon\.ico$" special
SetEnvIf Request_URI "something.html" special
 
# no logging:
CustomLog /var/log/httpd/local-access.log combined env=!special
 
# explicit logging:
CustomLog /var/log/httpd/local-special.log combined env=special

This will exclude the given Request_URI from your main log and send them to the special log instead.

logrotate

The standard logfiles will be handled by logrotate:

/etc/logrotate.d/apache

/usr/local/apache/current/logs/access_log
/usr/local/apache/current/logs/error_log
/usr/local/apache/current/ssl_engine_log
/usr/local/apache/current/ssl_scache.pag {
        rotate 3
        compress
        missingok
        size 15M
        postrotate
                /usr/bin/killall -HUP /usr/local/apache/current/bin/httpd
        endscript
}

What you will find at Debian with apache2 installed:

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 640 root adm
        sharedscripts
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                        /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}
apache/logfiles.txt · Last modified: 2011/05/25 14:31 by tb
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0