Reducing error log size

I'd like to reduce the amount of information that is logged in the error_log and access_log in /etc/local/apache/logs

Currently it records missing 404's, missing robots, missing favicon's, jpg, etc, etc.

This all adds up to wasted resources, huge log files, extra reboots, hard to read logs, and sexually transmitted diseases.

I've found the following info very helpful (ie this is how you do it), however I haven't had success so far.

<VirtualHost *:80>
...
# Logging --
# Filter out everything of no importance to reduce the logging load
# Check the logs periodically to make sure this filter is up-to-date **
<IfModule mod_setenvif.c>
# Filter out what we don't want to log
SetEnvIf Request_URI "\.gif$" no_log
SetEnvIf Request_URI "\.jpg$" no_log
SetEnvIf Request_URI "\.png$" no_log
SetEnvIf Request_URI "\.css$" no_log
SetEnvIf Request_URI "\.js$" no_log
SetEnvIf Request_URI "\.ico$" no_log
SetEnvIf Request_URI "css.css" no_log
SetEnvIf Request_URI "robots.txt" no_log
</IfModule>

# Log what we need for awstats
LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" mylog
CustomLog /var/log/httpd/mysite-access_log mylog env=!no_log
ErrorLog /var/log/httpd/mysite-error_log
...
</VirtualHost>


Here are my particulars:
OS: 2.4.20-021stab028.17.777-enterprise
Apache: 1.3.33
Cpanel 10.2.0-RELEASE 82

So I'd like to ensure the logging is fixed for each domain I create.. is it possible? Or do I need to tweak each entry in the httpd.conf?

Does ALL of the above need to be in each virtual container? Or one statement in the main part of the conf, and then just the CustomLog line per container?

Thanks for any help!

 

 

 

 

Top