mod_log_debug.html.en revision c11bfe6804eff2f4c7054cf2f7b06f0c8b32e596
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml version="1.0" encoding="ISO-8859-1"?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is generated from xml source: DO NOT EDIT
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
b686b6a420bde7f78c416b90be11db94cb789979nd -->
b686b6a420bde7f78c416b90be11db94cb789979nd<title>mod_log_debug - Apache HTTP Server</title>
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
b686b6a420bde7f78c416b90be11db94cb789979nd<script src="/style/scripts/prettify.js" type="text/javascript">
b686b6a420bde7f78c416b90be11db94cb789979nd</script>
b686b6a420bde7f78c416b90be11db94cb789979nd
b686b6a420bde7f78c416b90be11db94cb789979nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
b686b6a420bde7f78c416b90be11db94cb789979nd<body>
b686b6a420bde7f78c416b90be11db94cb789979nd<div id="page-header">
b686b6a420bde7f78c416b90be11db94cb789979nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<p class="apache">Apache HTTP Server Version 2.5</p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<img alt="" src="/images/feather.gif" /></div>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<div id="path">
b05ab3ff5ab54aa22610b13d56eaba6ddfc3db60nd<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Modules</a></div>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<div id="page-content">
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<div id="preamble"><h1>Apache Module mod_log_debug</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
b686b6a420bde7f78c416b90be11db94cb789979nd<p><span>Available Languages: </span><a href="/en/mod/mod_log_debug.html" title="English">&nbsp;en&nbsp;</a></p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Additional configurable debug logging</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>log_debug_module</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_log_debug.c</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.3.14 and later</td></tr></table>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd</div>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<div id="quickview"><h3 class="directives">Directives</h3>
5b10fd3977e6dfff19afe770e612e276962f7950nd<ul id="toc">
5b10fd3977e6dfff19afe770e612e276962f7950nd<li><img alt="" src="/images/down.gif" /> <a href="#logmessage">LogMessage</a></li>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd</ul>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<h3>Topics</h3>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<ul id="topics">
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</a></li>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<div class="section">
5b10fd3977e6dfff19afe770e612e276962f7950nd<h2><a name="examples" id="examples">Examples</a></h2>
5b10fd3977e6dfff19afe770e612e276962f7950nd
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd <ol>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd <li>
2aff288113d772cedca6add888eb643afffe9fb1nd Log message after request to /foo/* is processed:
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd
2aff288113d772cedca6add888eb643afffe9fb1nd <pre class="prettyprint lang-config">
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd&lt;Location /foo/&gt;
7fa75a06a4fee19e995c069ee00310455d1452e1pquerna&nbsp;&nbsp;LogMessage "/foo/ has been requested"
7fa75a06a4fee19e995c069ee00310455d1452e1pquerna&lt;/Location&gt;
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd </pre>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd
2aff288113d772cedca6add888eb643afffe9fb1nd </li>
2aff288113d772cedca6add888eb643afffe9fb1nd
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd <li>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd Log message if request to /foo/* is processed in a sub-request:
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd <pre class="prettyprint lang-config">
2aff288113d772cedca6add888eb643afffe9fb1nd&lt;Location /foo/&gt;
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd&nbsp;&nbsp;LogMessage "subrequest to /foo/" hook=type_checker expr=%{IS_SUBREQ}
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd&lt;/Location&gt;
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd </pre>
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd
2aff288113d772cedca6add888eb643afffe9fb1nd
2aff288113d772cedca6add888eb643afffe9fb1nd The default log_transaction hook is not executed for sub-requests,
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd therefore we have to use a different hook.
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd </li>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd
db99fa79ac42b9cc42b63386eb289aecb0f3cb9cnd
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd <li>
2aff288113d772cedca6add888eb643afffe9fb1nd Log message if an IPv6 client causes a request timeout:
2aff288113d772cedca6add888eb643afffe9fb1nd <pre class="prettyprint lang-config">
2aff288113d772cedca6add888eb643afffe9fb1nd LogMessage "IPv6 timeout from %{REMOTE_ADDR}" "expr=-T %{IPV6} &amp;&amp; %{REQUEST_STATUS} = 408"
2aff288113d772cedca6add888eb643afffe9fb1nd </pre>
2aff288113d772cedca6add888eb643afffe9fb1nd
2aff288113d772cedca6add888eb643afffe9fb1nd Note the placing of the double quotes for the <code>expr=</code> argument.
2aff288113d772cedca6add888eb643afffe9fb1nd </li>
2aff288113d772cedca6add888eb643afffe9fb1nd
2aff288113d772cedca6add888eb643afffe9fb1nd <li>
2aff288113d772cedca6add888eb643afffe9fb1nd Log the value of the "X-Foo" request environment variable in each
2aff288113d772cedca6add888eb643afffe9fb1nd stage of the request:
aa0b2780958e9b1467c9d0153a05738e399811a5nd <pre class="prettyprint lang-config">
2aff288113d772cedca6add888eb643afffe9fb1nd&lt;Location /&gt;
42af92a661a06b3cebc88d585aad75064a309d51nd&nbsp;&nbsp;LogMessage "%{reqenv:X-Foo}" hook=all
42af92a661a06b3cebc88d585aad75064a309d51nd&lt;/Location&gt;
2aff288113d772cedca6add888eb643afffe9fb1nd </pre>
aa0b2780958e9b1467c9d0153a05738e399811a5nd
2aff288113d772cedca6add888eb643afffe9fb1nd Together with microsecond time stamps in the error log,
2aff288113d772cedca6add888eb643afffe9fb1nd <code>hook=all</code> also allows to determine the times spent
2aff288113d772cedca6add888eb643afffe9fb1nd in the different parts of the request processing.
64c02f1310b7747423957823ee09fb3608430f89nd </li>
aa0b2780958e9b1467c9d0153a05738e399811a5nd
2aff288113d772cedca6add888eb643afffe9fb1nd </ol>
2aff288113d772cedca6add888eb643afffe9fb1nd</div>
2aff288113d772cedca6add888eb643afffe9fb1nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<div class="directive-section"><h2><a name="LogMessage" id="LogMessage">LogMessage</a> <a name="logmessage" id="logmessage">Directive</a></h2>
2aff288113d772cedca6add888eb643afffe9fb1nd<table class="directive">
2aff288113d772cedca6add888eb643afffe9fb1nd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Log userdefined message to error log
2aff288113d772cedca6add888eb643afffe9fb1nd</td></tr>
2aff288113d772cedca6add888eb643afffe9fb1nd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogMessage <var>message</var>
2aff288113d772cedca6add888eb643afffe9fb1nd[hook=<var>hook</var>] [expr=<var>expression</var>]
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd</code></td></tr>
2aff288113d772cedca6add888eb643afffe9fb1nd<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset</code></td></tr>
e67fa8d3f161e595dd448fc24a591ee17ae59131nd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
05ede5110427cb9dc071cc671d5aaba5d3b88c79nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Experimental</td></tr>
bf94bedcb62d7f0b926f4286069def5ee6b07b60nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_debug</td></tr>
bf94bedcb62d7f0b926f4286069def5ee6b07b60nd</table>
2aff288113d772cedca6add888eb643afffe9fb1nd <p>This directive causes a user defined message to be logged to the
2aff288113d772cedca6add888eb643afffe9fb1nd error log. The message can use variables and functions from the
bbcbf978a3074512c627c797fedcb30eeab7b39dslive <a href="/expr.html">ap_expr syntax</a>. References to HTTP headers
ee5db395bc3723609919edfa96af387eea37c491jim will not cause header names to be added to the Vary header. The
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd messages are logged at loglevel info.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd <p>The hook specifies before which phase of request procesing the message
e55e60efce8a3e2139132c1d6ad9f6f0d2976614nd will be logged. The following hooks are supported:</p>
2aff288113d772cedca6add888eb643afffe9fb1nd
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive <table class="bordered"><tr class="header"><th>Name</th></tr>
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive<tr><td><code>translate_name</code></td></tr>
7f3fdc63be07f2ad39e01a44e68e9324998a5c03slive<tr class="odd"><td><code>type_checker</code></td></tr>
75585bd48fe0f30483dba4762e61edf39ea3e0f6nd<tr><td><code>quick_handler</code></td></tr>
75585bd48fe0f30483dba4762e61edf39ea3e0f6nd<tr class="odd"><td><code>map_to_storage</code></td></tr>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<tr><td><code>check_access</code></td></tr>
03a4ff9ac4c9b8009249010e7c53bb86ff05915and<tr class="odd"><td><code>check_access_ex</code></td></tr>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<tr><td><code>insert_filter</code></td></tr>
3b58542e01ec69422f3086db5825a12fc77b726end<tr class="odd"><td><code>check_authn</code></td></tr>
a0d937b340692a3578f1d2f2535890c520c4bf0cnd<tr><td><code>check_authz</code></td></tr>
a0d937b340692a3578f1d2f2535890c520c4bf0cnd<tr class="odd"><td><code>fixups</code></td></tr>
2aff288113d772cedca6add888eb643afffe9fb1nd<tr><td><code>handler</code></td></tr>
2aff288113d772cedca6add888eb643afffe9fb1nd<tr class="odd"><td><code>log_transaction</code></td></tr>
2aff288113d772cedca6add888eb643afffe9fb1nd</table>
2aff288113d772cedca6add888eb643afffe9fb1nd
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd <p>The default is <code>log_transaction</code>. The special value
08842292d2f1550b40ae73e0dafc7641c5955c82nd <code>all</code> is also supported, causing a message to be logged at each
2aff288113d772cedca6add888eb643afffe9fb1nd phase. Not all hooks are executed for every request.</p>
d2b809e5d72658bff23819d8b77f20e4939af541nd
2aff288113d772cedca6add888eb643afffe9fb1nd <p>The optional expression allows to restrict the message if a
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd condition is met. The details of the expression syntax are described in
2aff288113d772cedca6add888eb643afffe9fb1nd the <a href="/expr.html">ap_expr documentation</a>. References to HTTP
2aff288113d772cedca6add888eb643afffe9fb1nd headers will not cause the header names to be added to the Vary header.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd
2aff288113d772cedca6add888eb643afffe9fb1nd
2aff288113d772cedca6add888eb643afffe9fb1nd</div>
2aff288113d772cedca6add888eb643afffe9fb1nd</div>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd<div class="bottomlang">
c023f60e35022146373e40249f0c8c8d623b6fcfnd<p><span>Available Languages: </span><a href="/en/mod/mod_log_debug.html" title="English">&nbsp;en&nbsp;</a></p>
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977nd<script type="text/javascript"><!--//--><![CDATA[//><!--
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977ndvar comments_shortname = 'httpd';
101bf3584c853027d9e51df6edfff5ff70c80238jimvar comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_log_debug.html';
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd(function(w, d) {
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd d.write('<div id="comments_thread"><\/div>');
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd var s = d.createElement('script');
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd s.type = 'text/javascript';
73ba54c33b4fcad0e13005e10ea8648c9fe4265bnd s.async = true;
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
2aff288113d772cedca6add888eb643afffe9fb1nd (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
80d3dc69b0e6ad772135f6a78af3d16bd6cccc42nd }
2aff288113d772cedca6add888eb643afffe9fb1nd else {
2aff288113d772cedca6add888eb643afffe9fb1nd d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
2aff288113d772cedca6add888eb643afffe9fb1nd }
2aff288113d772cedca6add888eb643afffe9fb1nd})(window, document);
2aff288113d772cedca6add888eb643afffe9fb1nd//--><!]]></script></div><div id="footer">
2aff288113d772cedca6add888eb643afffe9fb1nd<p class="apache">Copyright 2012 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
2aff288113d772cedca6add888eb643afffe9fb1nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
2aff288113d772cedca6add888eb643afffe9fb1ndif (typeof(prettyPrint) !== 'undefined') {
2aff288113d772cedca6add888eb643afffe9fb1nd prettyPrint();
2aff288113d772cedca6add888eb643afffe9fb1nd}
2aff288113d772cedca6add888eb643afffe9fb1nd//--><!]]></script>
2aff288113d772cedca6add888eb643afffe9fb1nd</body></html>