mod_log_debug.xml revision 1f1b6bf13313fdd14a45e52e553d3ff28689b717
9b2bd54c98edb185a3985410367754ab33217362bnicholes<?xml version="1.0"?>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
9b2bd54c98edb185a3985410367754ab33217362bnicholes<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<!-- $LastChangedRevision$ -->
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes<!--
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
9b2bd54c98edb185a3985410367754ab33217362bnicholes http://www.apache.org/licenses/LICENSE-2.0
9b2bd54c98edb185a3985410367754ab33217362bnicholes
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.
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg-->
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg
16b55a35cff91315d261d1baa776138af465c4e4fuankg<modulesynopsis metafile="mod_log_debug.xml.meta">
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes<name>mod_log_debug</name>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<description>Additional configurable debug logging</description>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<status>Experimental</status>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<sourcefile>mod_log_debug.c</sourcefile>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<identifier>log_debug_module</identifier>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<compatibility>Available in Apache 2.3.14 and later</compatibility>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes<section id="examples"><title>Examples</title>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes <ol>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log message after request to /foo/* is processed:
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes <highlight language="config">
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;Location "/foo/"&gt;
9b2bd54c98edb185a3985410367754ab33217362bnicholes&nbsp;&nbsp;LogMessage "/foo/ has been requested"
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;/Location&gt;
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes </li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes <li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log message if request to /foo/* is processed in a sub-request:
9b2bd54c98edb185a3985410367754ab33217362bnicholes <highlight language="config">
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;Location "/foo/"&gt;
9b2bd54c98edb185a3985410367754ab33217362bnicholes&nbsp;&nbsp;LogMessage "subrequest to /foo/" hook=type_checker expr=%{IS_SUBREQ}
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;/Location&gt;
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes The default log_transaction hook is not executed for sub-requests,
9b2bd54c98edb185a3985410367754ab33217362bnicholes therefore we have to use a different hook.
9b2bd54c98edb185a3985410367754ab33217362bnicholes </li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes <li>
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes Log message if an IPv6 client causes a request timeout:
9b2bd54c98edb185a3985410367754ab33217362bnicholes <highlight language="config">
9b2bd54c98edb185a3985410367754ab33217362bnicholes LogMessage "IPv6 timeout from %{REMOTE_ADDR}" "expr=-T %{IPV6} &amp;&amp; %{REQUEST_STATUS} = 408"
9b2bd54c98edb185a3985410367754ab33217362bnicholes </highlight>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Note the placing of the double quotes for the <code>expr=</code> argument.
9b2bd54c98edb185a3985410367754ab33217362bnicholes </li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes <li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes Log the value of the "X-Foo" request environment variable in each
9b2bd54c98edb185a3985410367754ab33217362bnicholes stage of the request:
9b2bd54c98edb185a3985410367754ab33217362bnicholes <highlight language="config">
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;Location "/"&gt;
9b2bd54c98edb185a3985410367754ab33217362bnicholes&nbsp;&nbsp;LogMessage "%{reqenv:X-Foo}" hook=all
9b2bd54c98edb185a3985410367754ab33217362bnicholes&lt;/Location&gt;
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 </li>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes </ol>
9b2bd54c98edb185a3985410367754ab33217362bnicholes</section>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes<directivesynopsis>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<name>LogMessage</name>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<description>Log user-defined message to error log
9b2bd54c98edb185a3985410367754ab33217362bnicholes</description>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<syntax>LogMessage <var>message</var>
9b2bd54c98edb185a3985410367754ab33217362bnicholes[hook=<var>hook</var>] [expr=<var>expression</var>]
9b2bd54c98edb185a3985410367754ab33217362bnicholes</syntax>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<default>Unset</default>
9b2bd54c98edb185a3985410367754ab33217362bnicholes<contextlist><context>directory</context>
9b2bd54c98edb185a3985410367754ab33217362bnicholes</contextlist>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes<usage>
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
9b2bd54c98edb185a3985410367754ab33217362bnicholes <p>The hook specifies before which phase of request processing the message
9b2bd54c98edb185a3985410367754ab33217362bnicholes will be logged. The following hooks are supported:</p>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes <table border="1" style="zebra">
9b2bd54c98edb185a3985410367754ab33217362bnicholes <columnspec><column width="1"/></columnspec>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><th>Name</th></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>translate_name</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>type_checker</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>quick_handler</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>map_to_storage</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>check_access</code></td></tr>
0662ed52e814f8f08ef0e09956413a792584eddffuankg <tr><td><code>check_access_ex</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>insert_filter</code></td></tr>
be06f010941d039a422f1bbd7e321a1a0e92e291bnicholes <tr><td><code>check_authn</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>check_authz</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>fixups</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>handler</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes <tr><td><code>log_transaction</code></td></tr>
9b2bd54c98edb185a3985410367754ab33217362bnicholes </table>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
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>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
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
0662ed52e814f8f08ef0e09956413a792584eddffuankg</usage>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes</directivesynopsis>
9b2bd54c98edb185a3985410367754ab33217362bnicholes
9b2bd54c98edb185a3985410367754ab33217362bnicholes</modulesynopsis>
9b2bd54c98edb185a3985410367754ab33217362bnicholes