Apache Don't Log 404 Errors
I have a MediaWiki installation, which returns a 404 error to the client when they request a page that doesn't exist yet. This is correct/desired behaviour, however it is also expected behaviour, so I don't want to log these errors to the log file. Examples of these logs are:
Code:
/index.php/ArchServer_Wiki:Current_events: 2 Time(s) I can use SetEnvIf to create a rule like: Code:
SetEnvIf Request_URI "^/index\.php/.*$" dontlog |
http://helicontech.blogspot.com/2009...abilities.html
Per status code differentiation We all like HTTP status 200. It means 'OK' and that's why we're not interested in loging it. Most common situation is when we are looking for some psecific status code in the logs. With mod_log_config you may create separate logs for every needed status. Please look at this configuration: CustomLog ok.log "%200t %200a,%200{User-Agent}i %200U%200q %200s" CustomLog redirections.log "%301t %301a,%301{User-Agent}i %301U%301q %301s" CustomLog not_found.log "%404t %404a,%404{User-Agent}i %404U%404q %404s" CustomLog server_error.log "%500t %500a,%500{User-Agent}i %500U%500q %500s" Hope this helps... |
Hmmm, a custom setenvif module... That could be a solution. Thanks, I hadn't seen that in my Googling :)
|
OK, well that software from a mod_rewrite clone for IIS, so that was a no go.... But I have found a solution! :D
Code:
RewriteEngine on |
All times are GMT -5. The time now is 01:12 PM. |