You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Eduardo Gomez <in...@yahoo.com> on 2002/03/19 13:59:41 UTC

conditional logging

Hello:

How do I prevent apache from logging both access to files with any
extension I want (*.gif, *.jpg, *.mp3, etc.)  and also that stupid
nimda / code red  stuff? I had it working but accidentally I wrote over
that particular httpd.conf file. Please, don't send me to:

> http://httpd.apache.org/docs/mod/mod_log_config.html#customlog
> http://httpd.apache.org/docs/logs.html#conditional
> http://httpd.apache.org/docs/env.html#examples

because last time I tried to figure that out, and I just got a big headache.

I'm using Apache on Windows.

I tried 3 or 4 GUIs for Apache so far. None gives the option of filtering
logged stuff by
their extension (.gif, .wav, etc). If they can build a GUI, that'd be
a pice of cake for them. Anyway....thanks in advance.

_________
Edward





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: conditional logging

Posted by Luis Moreira <la...@bes.pt>.
Conditional Logging
There are times when it is convenient to exclude certain entries from the access logs based on characteristics of the client request. This is easily accomplished with the help of environment variables. First, an environment variable must be set to indicate that the request meets certain conditions. This is usually accomplished with SetEnvIf. Then the env= clause of the CustomLog directive is used to include or exclude requests where the environment variable is set. Some examples:

  # Mark requests from the loop-back interface
  SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
  # Mark requests for the robots.txt file
  SetEnvIf Request_URI "^/robots\.txt$" dontlog
  # Log what remains
  CustomLog logs/access_log common env=!dontlog 
This text was taken from http://httpd.apache.org/docs-2.0/logs.html#conditional
I hope it helps

Luis

Teach children, so you don't have to punish adults (Pitagoras)

----- Original Message ----- 
From: "Eduardo Gomez" <in...@yahoo.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, March 19, 2002 12:59 PM
Subject: conditional logging


> Hello:
> 
> How do I prevent apache from logging both access to files with any
> extension I want (*.gif, *.jpg, *.mp3, etc.)  and also that stupid
> nimda / code red  stuff? I had it working but accidentally I wrote over
> that particular httpd.conf file. Please, don't send me to:
> 
> > http://httpd.apache.org/docs/mod/mod_log_config.html#customlog
> > http://httpd.apache.org/docs/logs.html#conditional
> > http://httpd.apache.org/docs/env.html#examples
> 
> because last time I tried to figure that out, and I just got a big headache.
> 
> I'm using Apache on Windows.
> 
> I tried 3 or 4 GUIs for Apache so far. None gives the option of filtering
> logged stuff by
> their extension (.gif, .wav, etc). If they can build a GUI, that'd be
> a pice of cake for them. Anyway....thanks in advance.
> 
> _________
> Edward
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: conditional logging

Posted by Joshua Slive <jo...@slive.ca>.
On Tue, 19 Mar 2002, Eduardo Gomez wrote:

> Hello:
>
> How do I prevent apache from logging both access to files with any
> extension I want (*.gif, *.jpg, *.mp3, etc.)  and also that stupid
> nimda / code red  stuff? I had it working but accidentally I wrote over
> that particular httpd.conf file. Please, don't send me to:
>
> > http://httpd.apache.org/docs/mod/mod_log_config.html#customlog
> > http://httpd.apache.org/docs/logs.html#conditional
> > http://httpd.apache.org/docs/env.html#examples
>
> because last time I tried to figure that out, and I just got a big headache.
>

Well, two of those three links contain examples that do almost exactly
what you want.  If you can't figure them out, then why don't you start by
showing us what your best effort is, and what happens when you try to
implement it.  Just telling us you don't understand the docs doesn't help
anyone.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org