]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_log_forensic.xml
Update transformations.
[apache] / docs / manual / mod / mod_log_forensic.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_log_forensic.xml.meta">
24
25 <name>mod_log_forensic</name>
26 <description>Forensic Logging of the requests made to the server</description>
27 <status>Extension</status>
28 <sourcefile>mod_log_forensic.c</sourcefile>
29 <identifier>log_forensic_module</identifier>
30 <compatibility><module>mod_unique_id</module> is no longer required since
31 version 2.1</compatibility>
32
33 <summary>
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     <directive module="mpm_common">CoreDumpDirectory</directive>
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 </summary>
52 <seealso><a href="../logs.html">Apache Log Files</a></seealso>
53 <seealso><module>mod_log_config</module></seealso>
54
55 <section id="formats"><title>Forensic Log Format</title>
56     <p>Each request is logged two times. The first time is <em>before</em> it's
57     processed further (that is, after receiving the headers). The second log
58     entry is written <em>after</em> the request processing at the same time
59     where normal logging occurs.</p>
60
61     <p>In order to identify each request, a unique request ID is assigned.
62     This forensic ID can be cross logged in the normal transfer log using the
63     <code>%{forensic-id}n</code> format string. If you're using
64     <module>mod_unique_id</module>, its generated ID will be used.</p>
65
66     <p>The first line logs the forensic ID, the request line and all received
67     headers, separated by pipe characters (<code>|</code>). A sample line
68     looks like the following (all on one line):</p>
69
70     <example>
71         +yQtJf8CoAB4AAFNXBIEAAAAA|GET /manual/de/images/down.gif
72         HTTP/1.1|Host:localhost%3a8080|User-Agent:Mozilla/5.0 (X11;
73         U; Linux i686; en-US; rv%3a1.6) Gecko/20040216
74         Firefox/0.8|Accept:image/png, <var>etc...</var>
75     </example>
76
77     <p>The plus character at the beginning indicates that this is the first log
78     line of this request. The second line just contains a minus character and
79     the ID again:</p>
80
81     <example>
82       -yQtJf8CoAB4AAFNXBIEAAAAA
83     </example>
84
85     <p>The <code>check_forensic</code> script takes as its argument the name
86     of the logfile. It looks for those <code>+</code>/<code>-</code> ID pairs
87     and complains if a request was not completed.</p>
88 </section>
89
90 <section id="security"><title>Security Considerations</title>
91     <p>See the <a
92     href="../misc/security_tips.html#serverroot">security tips</a>
93     document for details on why your security could be compromised
94     if the directory where logfiles are stored is writable by
95     anyone other than the user that starts the server.</p>
96 </section>
97
98 <directivesynopsis>
99 <name>ForensicLog</name>
100 <description>Sets filename of the forensic log</description>
101 <syntax>ForensicLog <var>filename</var>|<var>pipe</var></syntax>
102 <contextlist><context>server config</context><context>virtual host</context>
103 </contextlist>
104
105 <usage>
106     <p>The <directive>ForensicLog</directive> directive is used to
107     log requests to the server for forensic analysis. Each log entry
108     is assigned a unique ID which can be associated with the request
109     using the normal <directive module="mod_log_config">CustomLog</directive>
110     directive. <module>mod_log_forensic</module> creates a token called
111     <code>forensic-id</code>, which can be added to the transfer log
112     using the <code>%{forensic-id}n</code> format string.</p>
113
114     <p>The argument, which specifies the location to which
115     the logs will be written, can take one of the following two
116     types of values:</p>
117
118     <dl>
119       <dt><var>filename</var></dt>
120       <dd>A filename, relative to the <directive module="core"
121       >ServerRoot</directive>.</dd>
122
123       <dt><var>pipe</var></dt>
124       <dd>The pipe character "<code>|</code>", followed by the path
125       to a program to receive the log information on its standard
126       input. The program name can be specified relative to the <directive
127       module="core">ServerRoot</directive> directive.
128
129       <note type="warning"><title>Security:</title>
130       <p>If a program is used, then it will be run as the user who
131       started <program>httpd</program>. This will be root if the server was
132       started by root; be sure that the program is secure or switches to a
133       less privileged user.</p>
134       </note>
135
136       <note><title>Note</title>
137         <p>When entering a file path on non-Unix platforms, care should be taken
138         to make sure that only forward slashes are used even though the platform
139         may allow the use of back slashes. In general it is a good idea to always 
140         use forward slashes throughout the configuration files.</p>
141       </note></dd>
142     </dl>
143 </usage>
144 </directivesynopsis>
145
146 </modulesynopsis>