From: Rich Bowen Date: Thu, 4 Nov 2010 19:02:51 +0000 (+0000) Subject: Mention the %200{var}i syntax in the conditional logging doc. X-Git-Tag: 2.3.9~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9870cb23645fb1ef9861ab049a076d6559e4fc33;p=thirdparty%2Fapache%2Fhttpd.git Mention the %200{var}i syntax in the conditional logging doc. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031155 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/logs.html.en b/docs/manual/logs.html.en index fb2a559ef00..7908cbf0d24 100644 --- a/docs/manual/logs.html.en +++ b/docs/manual/logs.html.en @@ -474,6 +474,21 @@ content without it. In that case a cache hit will log -, while a cache miss will log 1.

+

In addition to the env= syntax, LogFormat supports logging values + conditional upon the HTTP response code:

+ +

+ LogFormat "%400,501{User-agent}i" browserlog
+ LogFormat "%!200,304,302{Referer}i" refererlog +

+ +

In the first example, the User-agent will be + logged if the HTTP status code is 400 or 501. In other cases, a + literal "-" will be logged instead. Likewise, in the second + example, the Referer will be logged if the HTTP + status code is not 200, 204, or 302. (Note the + "!" before the status codes.

+

Although we have just shown that conditional logging is very powerful and flexible, it is not the only way to control the contents of the logs. Log files are more useful when they diff --git a/docs/manual/logs.xml b/docs/manual/logs.xml index b1ec7f0d1f6..a762d9d2c46 100644 --- a/docs/manual/logs.xml +++ b/docs/manual/logs.xml @@ -504,6 +504,22 @@ content without it. In that case a cache hit will log -, while a cache miss will log 1.

+

In addition to the env= syntax, LogFormat supports logging values + conditional upon the HTTP response code:

+ + + LogFormat "%400,501{User-agent}i" browserlog
+ LogFormat "%!200,304,302{Referer}i" refererlog +
+ +

In the first example, the User-agent will be + logged if the HTTP status code is 400 or 501. In other cases, a + literal "-" will be logged instead. Likewise, in the second + example, the Referer will be logged if the HTTP + status code is not 200, 204, or 302. (Note the + "!" before the status codes.

+

Although we have just shown that conditional logging is very powerful and flexible, it is not the only way to control the contents of the logs. Log files are more useful when they