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