Author |
|
spodletela
Joined: 02 Oct 2008 Posts: 3
|
Posted: Thu 02 Apr '09 10:53 Post subject: Disable logging of 404 |
|
|
Hi, i have a bit specific problem but i am not able to find the answer.
I have a directory with images and php script that shows them based on 404 handler (ErrorDocument 404 /returnimage.php) which checks if user is registered, doing some logging etc and returns correct headers and image. It works like a charm but i got a nasty message within error logs (ErrorLog):
[Thu Apr 02 10:47:06 2009] [error] [client x.x.x.x] File does not exist: x.gif, referer: x
I would like to disable this as it fills my logs without any need but i am unable to find some info how to do it... can someone please help me?
Last edited by spodletela on Thu 02 Apr '09 13:08; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 02 Apr '09 11:23 Post subject: |
|
|
maybe you can create a rule with setenv that apache don't log 404 in that directory.
http://httpd.apache.org/docs/2.2/logs.html search Conditional Logs
example
Code: |
SetEnvIf Request_URI "^/robots\.txt$" dontlog
CustomLog logs/access_log common env=!dontlog
|
|
|
Back to top |
|
spodletela
Joined: 02 Oct 2008 Posts: 3
|
Posted: Thu 02 Apr '09 12:56 Post subject: |
|
|
oh i forgot to mention, the problem is with ErrorLog
I have added it to initial post. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Thu 02 Apr '09 17:29 Post subject: |
|
|
Fine . .same rule applies .. just different words.
Like Redirect_Status instead of Request_URI, and "404" instead of "^/robots\.txt$" and last but certainly not least, ErrorLog instead of CustomLog. |
|
Back to top |
|
jeff00seattle
Joined: 17 Sep 2009 Posts: 9
|
Posted: Thu 17 Sep '09 7:40 Post subject: |
|
|
Hi spodletela
You stated that you got 404 handler (ErrorDocument 404 /returnimage.php) working like a charm.
How did you do it, because I am having trouble as stated in this posting:
http://www.apachelounge.com/viewtopic.php?t=3177
I am using Apache 2.2 on Windows.
Thanks
Jeff in Seattle |
|
Back to top |
|