]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_log_forensic.html.en
update transformation
[apache] / docs / manual / mod / mod_log_forensic.html.en
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
4         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5               This file is generated from xml source: DO NOT EDIT
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7       -->
8 <title>mod_log_forensic - Apache HTTP Server</title>
9 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
10 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
11 <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" />
12 <script src="../style/scripts/prettify.js" type="text/javascript">
13 </script>
14
15 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
16 <body>
17 <div id="page-header">
18 <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>
19 <p class="apache">Apache HTTP Server Version 2.5</p>
20 <img alt="" src="../images/feather.gif" /></div>
21 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
22 <div id="path">
23 <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>
24 <div id="page-content">
25 <div id="preamble"><h1>Apache Module mod_log_forensic</h1>
26 <div class="toplang">
27 <p><span>Available Languages: </span><a href="../en/mod/mod_log_forensic.html" title="English">&nbsp;en&nbsp;</a> |
28 <a href="../ja/mod/mod_log_forensic.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
29 <a href="../tr/mod/mod_log_forensic.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
30 </div>
31 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Forensic Logging of the requests made to the server</td></tr>
32 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
33 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>log_forensic_module</td></tr>
34 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_log_forensic.c</td></tr>
35 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td><code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is no longer required since
36 version 2.1</td></tr></table>
37 <h3>Summary</h3>
38
39     <p>This module provides for forensic logging of client
40     requests. Logging is done before and after processing a request, so the
41     forensic log contains two log lines for each request.
42     The forensic logger is very strict, which means:</p>
43
44     <ul>
45     <li>The format is fixed. You cannot modify the logging format at
46     runtime.</li>
47     <li>If it cannot write its data, the child process
48     exits immediately and may dump core (depending on your
49     <code class="directive"><a href="../mod/mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></code>
50     configuration).</li>
51     </ul>
52
53     <p>The <code>check_forensic</code> script, which can be found in the
54     distribution's support directory, may be helpful in evaluating the
55     forensic log output.</p>
56 </div>
57 <div id="quickview"><h3 class="directives">Directives</h3>
58 <ul id="toc">
59 <li><img alt="" src="../images/down.gif" /> <a href="#forensiclog">ForensicLog</a></li>
60 </ul>
61 <h3>Topics</h3>
62 <ul id="topics">
63 <li><img alt="" src="../images/down.gif" /> <a href="#formats">Forensic Log Format</a></li>
64 <li><img alt="" src="../images/down.gif" /> <a href="#security">Security Considerations</a></li>
65 </ul><h3>See also</h3>
66 <ul class="seealso">
67 <li><a href="../logs.html">Apache Log Files</a></li>
68 <li><code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code></li>
69 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
70 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
71 <div class="section">
72 <h2><a name="formats" id="formats">Forensic Log Format</a></h2>
73     <p>Each request is logged two times. The first time is <em>before</em> it's
74     processed further (that is, after receiving the headers). The second log
75     entry is written <em>after</em> the request processing at the same time
76     where normal logging occurs.</p>
77
78     <p>In order to identify each request, a unique request ID is assigned.
79     This forensic ID can be cross logged in the normal transfer log using the
80     <code>%{forensic-id}n</code> format string. If you're using
81     <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code>, its generated ID will be used.</p>
82
83     <p>The first line logs the forensic ID, the request line and all received
84     headers, separated by pipe characters (<code>|</code>). A sample line
85     looks like the following (all on one line):</p>
86
87     <div class="example"><p><code>
88         +yQtJf8CoAB4AAFNXBIEAAAAA|GET /manual/de/images/down.gif
89         HTTP/1.1|Host:localhost%3a8080|User-Agent:Mozilla/5.0 (X11;
90         U; Linux i686; en-US; rv%3a1.6) Gecko/20040216
91         Firefox/0.8|Accept:image/png, <var>etc...</var>
92     </code></p></div>
93
94     <p>The plus character at the beginning indicates that this is the first log
95     line of this request. The second line just contains a minus character and
96     the ID again:</p>
97
98     <div class="example"><p><code>
99       -yQtJf8CoAB4AAFNXBIEAAAAA
100     </code></p></div>
101
102     <p>The <code>check_forensic</code> script takes as its argument the name
103     of the logfile. It looks for those <code>+</code>/<code>-</code> ID pairs
104     and complains if a request was not completed.</p>
105 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
106 <div class="section">
107 <h2><a name="security" id="security">Security Considerations</a></h2>
108     <p>See the <a href="../misc/security_tips.html#serverroot">security tips</a>
109     document for details on why your security could be compromised
110     if the directory where logfiles are stored is writable by
111     anyone other than the user that starts the server.</p>
112 </div>
113 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
114 <div class="directive-section"><h2><a name="ForensicLog" id="ForensicLog">ForensicLog</a> <a name="forensiclog" id="forensiclog">Directive</a></h2>
115 <table class="directive">
116 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets filename of the forensic log</td></tr>
117 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForensicLog <var>filename</var>|<var>pipe</var></code></td></tr>
118 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
119 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
120 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_forensic</td></tr>
121 </table>
122     <p>The <code class="directive">ForensicLog</code> directive is used to
123     log requests to the server for forensic analysis. Each log entry
124     is assigned a unique ID which can be associated with the request
125     using the normal <code class="directive"><a href="../mod/mod_log_config.html#customlog">CustomLog</a></code>
126     directive. <code class="module"><a href="../mod/mod_log_forensic.html">mod_log_forensic</a></code> creates a token called
127     <code>forensic-id</code>, which can be added to the transfer log
128     using the <code>%{forensic-id}n</code> format string.</p>
129
130     <p>The argument, which specifies the location to which
131     the logs will be written, can take one of the following two
132     types of values:</p>
133
134     <dl>
135       <dt><var>filename</var></dt>
136       <dd>A filename, relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</dd>
137
138       <dt><var>pipe</var></dt>
139       <dd>The pipe character "<code>|</code>", followed by the path
140       to a program to receive the log information on its standard
141       input. The program name can be specified relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> directive.
142
143       <div class="warning"><h3>Security:</h3>
144       <p>If a program is used, then it will be run as the user who
145       started <code class="program"><a href="../programs/httpd.html">httpd</a></code>. This will be root if the server was
146       started by root; be sure that the program is secure or switches to a
147       less privileged user.</p>
148       </div>
149
150       <div class="note"><h3>Note</h3>
151         <p>When entering a file path on non-Unix platforms, care should be taken
152         to make sure that only forward slashes are used even though the platform
153         may allow the use of back slashes. In general it is a good idea to always
154         use forward slashes throughout the configuration files.</p>
155       </div></dd>
156     </dl>
157
158 </div>
159 </div>
160 <div class="bottomlang">
161 <p><span>Available Languages: </span><a href="../en/mod/mod_log_forensic.html" title="English">&nbsp;en&nbsp;</a> |
162 <a href="../ja/mod/mod_log_forensic.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
163 <a href="../tr/mod/mod_log_forensic.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
164 </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>This section is experimental!</strong><br />Comments placed here should not be expected 
165 to last beyond the testing phase of this system, nor do we in any way guarantee that we'll read them.</div>
166 <script type="text/javascript"><!--//--><![CDATA[//><!--
167 var disqus_shortname = 'httpd';
168 var disqus_identifier = 'http://httpd.apache.org/docs/2.4/mod/mod_log_forensic.html.en';
169 (function(w, d) {
170     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
171         d.write('<div id="disqus_thread"><\/div>');
172         var s = d.createElement('script');
173         s.type = 'text/javascript';
174         s.async = true;
175         s.src = 'http' + '://' + disqus_shortname + '.disqus.com/embed.js';
176         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
177     }
178     else {
179         d.write('<div id="disqus_thread">Comments have been disabled for offline viewing.<\/div>');
180     }
181 })(window, document);
182 //--><!]]></script></div><div id="footer">
183 <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>
184 <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[//><!--
185 if (typeof(prettyPrint) !== 'undefined') {
186     prettyPrint();
187 }
188 //--><!]]></script>
189 </body></html>