]> 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" />
12 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
13 <body>
14 <div id="page-header">
15 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p>
16 <p class="apache">Apache HTTP Server Version 2.1</p>
17 <img alt="" src="../images/feather.gif" /></div>
18 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
19 <div id="path">
20 <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-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_log_forensic</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_log_forensic.html" title="English">&nbsp;en&nbsp;</a></p>
25 </div>
26 <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>
27 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
28 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>log_forensic_module</td></tr>
29 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_log_forensic.c</td></tr>
30 <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
31 version 2.1</td></tr></table>
32 <h3>Summary</h3>
33
34     <p>This module provides for forensic logging of client
35     requests. Logging is done before and after processing a request, so the
36     forensic log contains two log lines for each request.
37     The forensic logger is very strict, which means:</p>
38
39     <ul>
40     <li>The format is fixed. You cannot modify the logging format at
41     runtime.</li>
42     <li>If it cannot write its data, the child process
43     exits immediately and may dump core (depending on your
44     <code class="directive"><a href="../mod/mpm_common.html#coredumpdirectory">CoreDumpDirectory</a></code>
45     configuration).</li>
46     </ul>
47
48     <p>The <code>check_forensic</code> script, which can be found in the
49     distribution's support directory, may be helpful in evaluating the
50     forensic log output.</p>
51 </div>
52 <div id="quickview"><h3 class="directives">Directives</h3>
53 <ul id="toc">
54 <li><img alt="" src="../images/down.gif" /> <a href="#forensiclog">ForensicLog</a></li>
55 </ul>
56 <h3>Topics</h3>
57 <ul id="topics">
58 <li><img alt="" src="../images/down.gif" /> <a href="#formats">Forensic Log Format</a></li>
59 <li><img alt="" src="../images/down.gif" /> <a href="#security">Security Considerations</a></li>
60 </ul><h3>See also</h3>
61 <ul class="seealso">
62 <li><a href="../logs.html">Apache Log Files</a></li>
63 <li><code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code></li>
64 </ul></div>
65 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
66 <div class="section">
67 <h2><a name="formats" id="formats">Forensic Log Format</a></h2>
68     <p>Each request is logged two times. The first time is <em>before</em> it's
69     processed further (that is, after receiving the headers). The second log
70     entry is written <em>after</em> the request processing at the same time
71     where normal logging occurs.</p>
72
73     <p>In order to identify each request, a unique request ID is assigned.
74     This forensic ID can be cross logged in the normal transfer log using the
75     <code>%{forensic-id}n</code> format string. If you're using
76     <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code>, its generated ID will be used.</p>
77
78     <p>The first line logs the forensic ID, the request line and all received
79     headers, separated by pipe characters (<code>|</code>). A sample line
80     looks like the following (all on one line):</p>
81
82     <div class="example"><p><code>
83         +yQtJf8CoAB4AAFNXBIEAAAAA|GET /manual/de/images/down.gif
84         HTTP/1.1|Host:localhost%3a8080|User-Agent:Mozilla/5.0 (X11;
85         U; Linux i686; en-US; rv%3a1.6) Gecko/20040216
86         Firefox/0.8|Accept:image/png, <var>etc...</var>
87     </code></p></div>
88
89     <p>The plus character at the beginning indicates that this is the first log
90     line of this request. The second line just contains a minus character and
91     the ID again:</p>
92
93     <div class="example"><p><code>
94       -yQtJf8CoAB4AAFNXBIEAAAAA
95     </code></p></div>
96
97     <p>The <code>check_forensic</code> script takes as its argument the name
98     of the logfile. It looks for those <code>+</code>/<code>-</code> ID pairs
99     and complains if a request was not completed.</p>
100 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
101 <div class="section">
102 <h2><a name="security" id="security">Security Considerations</a></h2>
103     <p>See the <a href="../misc/security_tips.html#serverroot">security tips</a>
104     document for details on why your security could be compromised
105     if the directory where logfiles are stored is writable by
106     anyone other than the user that starts the server.</p>
107 </div>
108 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
109 <div class="directive-section"><h2><a name="ForensicLog" id="ForensicLog">ForensicLog</a> <a name="forensiclog" id="forensiclog">Directive</a></h2>
110 <table class="directive">
111 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets filename of the forensic log</td></tr>
112 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForensicLog <var>filename</var>|<var>pipe</var></code></td></tr>
113 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
114 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
115 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_forensic</td></tr>
116 </table>
117     <p>The <code class="directive">ForensicLog</code> directive is used to
118     log requests to the server for forensic analysis. Each log entry
119     is assigned a unique ID which can be associated with the request
120     using the normal <code class="directive"><a href="../mod/mod_log_config.html#customlog">CustomLog</a></code>
121     directive. <code class="module"><a href="../mod/mod_log_forensic.html">mod_log_forensic</a></code> creates a token called
122     <code>forensic-id</code>, which can be added to the transfer log
123     using the <code>%{forensic-id}n</code> format string.</p>
124
125     <p>The argument, which specifies the location to which
126     the logs will be written, can take one of the following two
127     types of values:</p>
128
129     <dl>
130       <dt><var>filename</var></dt>
131       <dd>A filename, relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</dd>
132
133       <dt><var>pipe</var></dt>
134       <dd>The pipe character "<code>|</code>", followed by the path
135       to a program to receive the log information on its standard
136       input. The program name can be specified relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code> directive.
137
138       <div class="warning"><h3>Security:</h3>
139       <p>If a program is used, then it will be run as the user who
140       started httpd. This will be root if the server was started by root;
141       be sure that the program is secure or switches to a less privileged
142       user.</p>
143       </div>
144
145       <div class="note"><h3>Note</h3>
146         <p>When entering a file path on non-Unix platforms, care should be taken
147         to make sure that only forward slashed are used even though the platform
148         may allow the use of back slashes. In general it is a good idea to always 
149         use forward slashes throughout the configuration files.</p>
150       </div></dd>
151     </dl>
152
153 </div>
154 </div>
155 <div class="bottomlang">
156 <p><span>Available Languages: </span><a href="../en/mod/mod_log_forensic.html" title="English">&nbsp;en&nbsp;</a></p>
157 </div><div id="footer">
158 <p class="apache">Copyright 1999-2004 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>
159 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="../faq/">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div>
160 </body></html>