Received: (from majordom@localhost) by hyperreal.org (8.8.5/8.8.5) id PAA25356; Fri, 15 Aug 1997 15:32:49 -0700 (PDT) Received: from gate-isdn.ukweb.com (gate-isdn.ukweb.com [194.152.65.149]) by hyperreal.org (8.8.5/8.8.5) with SMTP id PAA25351 for ; Fri, 15 Aug 1997 15:32:44 -0700 (PDT) Received: from aardvark.ukweb.com [192.168.2.4] by gate-isdn.ukweb.com with smtp (Exim 1.61 #1) id 0wzUvv-0003mt-00; Fri, 15 Aug 1997 23:33:27 +0100 Date: Fri, 15 Aug 1997 23:32:38 +0100 (BST) From: Paul Sutton To: new-httpd@apache.org Subject: Re: [PATCH] Disabling logging based on envariable In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org On Fri, 15 Aug 1997, Rob Hartill wrote: > Assuming this patch doesn't disable logging to specific logs, how about > something like this.. I think creating another sectioning directive just for log file definition is probably a little over the top. I would prefer to acheive this functionality using SetEnvIf and a "CustomLogIf" directive. But it may not be possible in all the cases you describe below.. > > LogFormat "%h - %u %t \"%r\" %s %b" > LogUnless env=that_bloody_robot_again > CustomLogIf that_bloody_robot_again logs/access_log "%h - %u %t \"%r\" %s %b" > > CustomLog logs/kaboom "%h - %u %t \"%r\" %s %b \"\" \"%{User-agent}i\"" > LogIf status>=500 > Would be nice to be able to say: SetEnvIf REQUEST_STATUS /^5/ is_error CustomLogIf is_error logs/kaboom "%h - %u %t \"%r\" %s %b \"\" \"${user-agent}i\"" but of course SetEnvIf is processed way too early. Um. > > CustomLog logs/referer "%{referer}i -> %U" > LogIf env=referer_exists > LogUnless env=referer_is_not_local > SetEnvIf Referer /./ referer_is_not_local SetEnvIf Referer /\.my_local_dom\// !referer_is_not_local CustomLogIf refer_is_not_local logs/referer "%{referer}i -> %U" Use of various combintions of SetEnv and SetEnvIf can be used to implement some form of conditional and boolean logic to logging (and other things, such as deny from env=xxx). //pcs