Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Conditional Logging Not Working

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  beginner help needed  
Author Message
msifakis

External


Since: Dec 29, 2003
Posts: 2



(Msg. 1) Posted: Mon Dec 29, 2003 4:54 pm
Post subject: Conditional Logging Not Working
Archived from groups: alt>apache>configuration (more info?)

Hello to all.

We are trying to reduce our log files by ignoring hits to certain
directories.
We are using the SetEnvIf command as illustrated below:

SetEnvIf Request_URI "/phplive/" env=ignore
CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/access_log.%Y%m%d"
combined env=!ignore

We have tried different arguments with this command to see if any
would work without any result. What are we missing? Does the SetEnvIf
need to be within the <IfModule mod_setenvif.c></IfModule> area? Does
the CustomLog command need to be placed after that area?

Thank you in advance for your help!

Manos Sifakis
customit.com

 >> Stay informed about: Conditional Logging Not Working 
Back to top
Login to vote
mfuhr

External


Since: Nov 17, 2003
Posts: 44



(Msg. 2) Posted: Mon Dec 29, 2003 11:24 pm
Post subject: Re: Conditional Logging Not Working [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

msifakis.RemoveThis@customit.com (Manos) writes:

 > We are trying to reduce our log files by ignoring hits to certain
 > directories.
 > We are using the SetEnvIf command as illustrated below:
 >
 > SetEnvIf Request_URI "/phplive/" env=ignore

The above directive is setting a variable named "env" to the value
"ignore", which probably isn't what you meant to do. See the SetEnvIf
documentation for the correct usage.

 > CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/access_log.%Y%m%d"
 > combined env=!ignore

The above is checking for a variable named "ignore", which isn't
the name of the variable you set with SetEnvIf.

 > We have tried different arguments with this command to see if any
 > would work without any result. What are we missing? Does the SetEnvIf
 > need to be within the <IfModule mod_setenvif.c></IfModule> area? Does
 > the CustomLog command need to be placed after that area?

SetEnvIf doesn't need to be in an <IfModule> section. If a directive
is outside an <IfModule> section then it'll always be used -- that's
why you get an "Invalid command" error if you use a directive for a
module that isn't present.

The order of SetEnvIf and CustomLog shouldn't matter. I just did
some tests and CustomLog did its job correctly whether it was before
SetEnvIf or after it.

Fix the SetEnvIf and CustomLog directives to use the same variable
and the problem should be solved.

--
Michael Fuhr
<a style='text-decoration: underline;' href="http://www.fuhr.org/~mfuhr/" target="_blank">http://www.fuhr.org/~mfuhr/</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Conditional Logging Not Working 
Back to top
Login to vote
msifakis

External


Since: Dec 29, 2003
Posts: 2



(Msg. 3) Posted: Tue Dec 30, 2003 9:35 am
Post subject: Re: Conditional Logging Not Working [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Michael,

Thanks a lot for your feedback! After so many trials you really lose your brain Wink

We took out

SetEnvIf Request_URI "/phplive/" env=ignore

And we placed this instead, setting the variable ignore

SetEnvIf Request_URI "/phplive/" ignore

We left the CustomLog directive as is

CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/access_log.%Y%m%d"
combined env=!ignore

Thanks again for your great feedback!

Regards,

Manos Sifakis
custom I.T. inc.


mfuhr DeleteThis @fuhr.org (Michael Fuhr) wrote in message news:<3ff0efe5$1_3@omega.dimensional.com>...
 > msifakis DeleteThis @customit.com (Manos) writes:
 >
  > > We are trying to reduce our log files by ignoring hits to certain
  > > directories.
  > > We are using the SetEnvIf command as illustrated below:
  > >
  > > SetEnvIf Request_URI "/phplive/" env=ignore
 >
 > The above directive is setting a variable named "env" to the value
 > "ignore", which probably isn't what you meant to do. See the SetEnvIf
 > documentation for the correct usage.
 >
  > > CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/access_log.%Y%m%d"
  > > combined env=!ignore
 >
 > The above is checking for a variable named "ignore", which isn't
 > the name of the variable you set with SetEnvIf.
 >
  > > We have tried different arguments with this command to see if any
  > > would work without any result. What are we missing? Does the SetEnvIf
  > > need to be within the <IfModule mod_setenvif.c></IfModule> area? Does
  > > the CustomLog command need to be placed after that area?
 >
 > SetEnvIf doesn't need to be in an <IfModule> section. If a directive
 > is outside an <IfModule> section then it'll always be used -- that's
 > why you get an "Invalid command" error if you use a directive for a
 > module that isn't present.
 >
 > The order of SetEnvIf and CustomLog shouldn't matter. I just did
 > some tests and CustomLog did its job correctly whether it was before
 > SetEnvIf or after it.
 >
 > Fix the SetEnvIf and CustomLog directives to use the same variable
 > and the problem should be solved.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Conditional Logging Not Working 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Logging and MySQL - I would like setup logging to a database verses a log file. Can someone recommend a procedure or tool to help with this? I am running apache on FreeBSD 5.1. Also are there any major security concerns I should be aware of? Thanks, Matt

Apache not logging referrers - Hello, I'm using Apache 2.0.46 on WinXP (yeah, I know.) When I go to check the logs I've noticed that none of the referrering sites are being logged. A typical entry looks like this: 64.36.xxx.xxx - - [17/Aug/2003:13:21:42 -0700] "GET / HTTP/1.1...

apache 1.3 vhost logging going to wrong place - hello. cant' figure this out yet. i've got a very simple vhost config. decided to separate logging so i add; CustomLog /some/place/access common ErrorLog /some/place/error this is inside the virtual host config. the files are created sure enough an...

Logging proxy request incoming to Apache - Hi all Apache users, I have setup Apache to act as a proxy between two hosts. Is it possible to log all the data that is coming to Apache, so that I can monitor that data passing between the 2 hosts ? Thanks a lot Francesco

Logging large scale apache 2.0 server with MANY vhosts - Hi All, I'm currently setting up a new server to handle a large number of VHOSTs. We are trying to use dynamically assigned section for vhosts. The dynamic section is working fine, all nice and peachy. Logging however is the problem. The docs state....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]