logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Disable logging of 404
Author
spodletela



Joined: 02 Oct 2008
Posts: 3

PostPosted: Thu 02 Apr '09 10:53    Post subject: Disable logging of 404 Reply with quote

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: 7298
Location: Germany, Next to Hamburg

PostPosted: Thu 02 Apr '09 11:23    Post subject: Reply with quote

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

PostPosted: Thu 02 Apr '09 12:56    Post subject: Reply with quote

oh i forgot to mention, the problem is with ErrorLog Sad

I have added it to initial post.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 02 Apr '09 17:29    Post subject: Reply with quote

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

PostPosted: Thu 17 Sep '09 7:40    Post subject: Reply with quote

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


Reply to topic   Topic: Disable logging of 404 View previous topic :: View next topic
Post new topic   Forum Index -> Apache