mod_log_debug.xml revision 1f1b6bf13313fdd14a45e52e553d3ff28689b717
9b2bd54c98edb185a3985410367754ab33217362bnicholes<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
9b2bd54c98edb185a3985410367754ab33217362bnicholes<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<!-- $LastChangedRevision$ -->
9b2bd54c98edb185a3985410367754ab33217362bnicholes Licensed to the Apache Software Foundation (ASF) under one or more
9b2bd54c98edb185a3985410367754ab33217362bnicholes contributor license agreements. See the NOTICE file distributed with
9b2bd54c98edb185a3985410367754ab33217362bnicholes this work for additional information regarding copyright ownership.
9b2bd54c98edb185a3985410367754ab33217362bnicholes The ASF licenses this file to You under the Apache License, Version 2.0
0662ed52e814f8f08ef0e09956413a792584eddffuankg (the "License"); you may not use this file except in compliance with
9b2bd54c98edb185a3985410367754ab33217362bnicholes the License. You may obtain a copy of the License at
9b2bd54c98edb185a3985410367754ab33217362bnicholes Unless required by applicable law or agreed to in writing, software
9b2bd54c98edb185a3985410367754ab33217362bnicholes distributed under the License is distributed on an "AS IS" BASIS,
9b2bd54c98edb185a3985410367754ab33217362bnicholes WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes See the License for the specific language governing permissions and
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes limitations under the License.
9b2bd54c98edb185a3985410367754ab33217362bnicholes<description>Additional configurable debug logging</description>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<compatibility>Available in Apache 2.3.14 and later</compatibility>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log message after request to /foo/* is processed:
9b2bd54c98edb185a3985410367754ab33217362bnicholes<Location "/foo/">
9b2bd54c98edb185a3985410367754ab33217362bnicholes LogMessage "/foo/ has been requested"
9b2bd54c98edb185a3985410367754ab33217362bnicholes</Location>
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log message if request to /foo/* is processed in a sub-request:
9b2bd54c98edb185a3985410367754ab33217362bnicholes<Location "/foo/">
9b2bd54c98edb185a3985410367754ab33217362bnicholes LogMessage "subrequest to /foo/" hook=type_checker expr=%{IS_SUBREQ}
9b2bd54c98edb185a3985410367754ab33217362bnicholes</Location>
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes The default log_transaction hook is not executed for sub-requests,
9b2bd54c98edb185a3985410367754ab33217362bnicholes therefore we have to use a different hook.
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes Log message if an IPv6 client causes a request timeout:
9b2bd54c98edb185a3985410367754ab33217362bnicholes LogMessage "IPv6 timeout from %{REMOTE_ADDR}" "expr=-T %{IPV6} && %{REQUEST_STATUS} = 408"
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Note the placing of the double quotes for the <code>expr=</code> argument.
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log the value of the "X-Foo" request environment variable in each
9b2bd54c98edb185a3985410367754ab33217362bnicholes stage of the request:
9b2bd54c98edb185a3985410367754ab33217362bnicholes<Location "/">
9b2bd54c98edb185a3985410367754ab33217362bnicholes LogMessage "%{reqenv:X-Foo}" hook=all
9b2bd54c98edb185a3985410367754ab33217362bnicholes</Location>
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Together with microsecond time stamps in the error log,
9b2bd54c98edb185a3985410367754ab33217362bnicholes <code>hook=all</code> also lets you determine the times spent
9b2bd54c98edb185a3985410367754ab33217362bnicholes in the different parts of the request processing.
9b2bd54c98edb185a3985410367754ab33217362bnicholes<directivesynopsis>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<description>Log user-defined message to error log
9b2bd54c98edb185a3985410367754ab33217362bnicholes</description>
9b2bd54c98edb185a3985410367754ab33217362bnicholes[hook=<var>hook</var>] [expr=<var>expression</var>]
9b2bd54c98edb185a3985410367754ab33217362bnicholes</contextlist>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <p>This directive causes a user defined message to be logged to the
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg error log. The message can use variables and functions from the
9b2bd54c98edb185a3985410367754ab33217362bnicholes <a href="/expr.html">ap_expr syntax</a>. References to HTTP headers
9b2bd54c98edb185a3985410367754ab33217362bnicholes will not cause header names to be added to the Vary header. The
9b2bd54c98edb185a3985410367754ab33217362bnicholes messages are logged at loglevel info.</p>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <p>The hook specifies before which phase of request processing the message
9b2bd54c98edb185a3985410367754ab33217362bnicholes will be logged. The following hooks are supported:</p>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <p>The default is <code>log_transaction</code>. The special value
9b2bd54c98edb185a3985410367754ab33217362bnicholes <code>all</code> is also supported, causing a message to be logged at each
9b2bd54c98edb185a3985410367754ab33217362bnicholes phase. Not all hooks are executed for every request.</p>
0662ed52e814f8f08ef0e09956413a792584eddffuankg <p>The optional expression allows to restrict the message if a
9b2bd54c98edb185a3985410367754ab33217362bnicholes condition is met. The details of the expression syntax are described in
9b2bd54c98edb185a3985410367754ab33217362bnicholes the <a href="/expr.html">ap_expr documentation</a>. References to HTTP
9b2bd54c98edb185a3985410367754ab33217362bnicholes headers will not cause the header names to be added to the Vary header.</p>
9b2bd54c98edb185a3985410367754ab33217362bnicholes</directivesynopsis>
9b2bd54c98edb185a3985410367754ab33217362bnicholes</modulesynopsis>