bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / apache2 / manual / mod / mod_log_config.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_config - 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.0</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/">Documentation</a> &gt; <a href="../">Version 2.0</a> &gt; <a href="./">Modules</a></div>
21 <div id="page-content">
22 <div id="preamble"><h1>Apache Module mod_log_config</h1>
23 <div class="toplang">
24 <p><span>Available Languages: </span><a href="../en/mod/mod_log_config.html" title="English">&nbsp;en&nbsp;</a> |
25 <a href="../ja/mod/mod_log_config.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
26 <a href="../ko/mod/mod_log_config.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
27 <a href="../tr/mod/mod_log_config.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
28 </div>
29 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Logging of the requests made to the server</td></tr>
30 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
31 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>log_config_module</td></tr>
32 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_log_config.c</td></tr></table>
33 <h3>Summary</h3>
34
35     <p>This module provides for flexible logging of client
36     requests. Logs are written in a customizable format, and may be
37     written directly to a file, or to an external program.
38     Conditional logging is provided so that individual requests may
39     be included or excluded from the logs based on characteristics
40     of the request.</p>
41
42     <p>Three directives are provided by this module:
43     <code class="directive"><a href="#transferlog">TransferLog</a></code> to create
44     a log file, <code class="directive"><a href="#logformat">LogFormat</a></code>
45     to set a custom format, and <code class="directive"><a href="#customlog">CustomLog</a></code> to define a log file and format in one
46     step. The <code class="directive">TransferLog</code> and <code class="directive">CustomLog</code> directives can be used multiple times in each
47     server to cause each request to be logged to multiple files.</p>
48 </div>
49 <div id="quickview"><h3 class="directives">Directives</h3>
50 <ul id="toc">
51 <li><img alt="" src="../images/down.gif" /> <a href="#bufferedlogs">BufferedLogs</a></li>
52 <li><img alt="" src="../images/down.gif" /> <a href="#cookielog">CookieLog</a></li>
53 <li><img alt="" src="../images/down.gif" /> <a href="#customlog">CustomLog</a></li>
54 <li><img alt="" src="../images/down.gif" /> <a href="#logformat">LogFormat</a></li>
55 <li><img alt="" src="../images/down.gif" /> <a href="#transferlog">TransferLog</a></li>
56 </ul>
57 <h3>Topics</h3>
58 <ul id="topics">
59 <li><img alt="" src="../images/down.gif" /> <a href="#formats">Custom Log Formats</a></li>
60 <li><img alt="" src="../images/down.gif" /> <a href="#security">Security Considerations</a></li>
61 </ul><h3>See also</h3>
62 <ul class="seealso">
63 <li><a href="../logs.html">Apache Log Files</a></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">Custom Log Formats</a></h2>
68
69     <p>The format argument to the <code class="directive"><a href="#logformat">LogFormat</a></code> and <code class="directive"><a href="#customlog">CustomLog</a></code> directives is a string. This string is
70     used to log each request to the log file. It can contain literal
71     characters copied into the log files and the C-style control
72     characters "\n" and "\t" to represent new-lines and tabs.
73     Literal quotes and backslashes should be escaped with
74     backslashes.</p>
75
76     <p>The characteristics of the request itself are logged by
77     placing "<code>%</code>" directives in the format string, which are
78     replaced in the log file by the values as follows:</p>
79
80     <table class="bordered"><tr class="header"><th>Format&nbsp;String</th>
81         <th>Description</th></tr>
82 <tr><td><code>%%</code></td>
83         <td>The percent sign (<em>Apache 2.0.44 and later</em>)</td></tr>
84 <tr class="odd"><td><code>%...a</code></td>
85         <td>Remote IP-address</td></tr>
86 <tr><td><code>%...A</code></td>
87         <td>Local IP-address</td></tr>
88 <tr class="odd"><td><code>%...B</code></td>
89         <td>Size of response in bytes, excluding HTTP headers.</td></tr>
90 <tr><td><code>%...b</code></td>
91         <td>Size of response in bytes, excluding HTTP headers. In CLF format, <em>i.e.</em>
92         a '<code>-</code>' rather than a 0 when no bytes are sent.</td></tr>
93 <tr class="odd"><td><code>%...{<var>Foobar</var>}C</code></td>
94         <td>The contents of cookie <var>Foobar</var> in the request sent
95         to the server.</td></tr>
96 <tr><td><code>%...D</code></td>
97         <td>The time taken to serve the request, in microseconds.</td></tr>
98 <tr class="odd"><td><code>%...{<var>FOOBAR</var>}e</code></td>
99         <td>The contents of the environment variable
100         <var>FOOBAR</var></td></tr>
101 <tr><td><code>%...f</code></td>
102         <td>Filename</td></tr>
103 <tr class="odd"><td><code>%...h</code></td>
104         <td>Remote host</td></tr>
105 <tr><td><code>%...H</code></td>
106         <td>The request protocol</td></tr>
107 <tr class="odd"><td><code>%...{<var>Foobar</var>}i</code></td>
108         <td>The contents of <code><var>Foobar</var>:</code> header line(s)
109         in the request sent to the server. Changes made by other
110         modules (e.g. <code class="module"><a href="../mod/mod_headers.html">mod_headers</a></code>) affect this.
111         </td></tr>
112 <tr><td><code>%...l</code></td>
113         <td>Remote logname (from identd, if supplied). This will return a
114         dash unless <code class="directive"><a href="../mod/core.html#identitycheck">IdentityCheck</a></code> is set
115         <code>On</code>.</td></tr>
116 <tr class="odd"><td><code>%...m</code></td>
117         <td>The request method</td></tr>
118 <tr><td><code>%...{<var>Foobar</var>}n</code></td>
119         <td>The contents of note <var>Foobar</var> from another
120         module.</td></tr>
121 <tr class="odd"><td><code>%...{<var>Foobar</var>}o</code></td>
122         <td>The contents of <code><var>Foobar</var>:</code> header line(s)
123         in the reply.</td></tr>
124 <tr><td><code>%...p</code></td>
125         <td>The canonical port of the server serving the request</td></tr>
126 <tr class="odd"><td><code>%...P</code></td>
127         <td>The process ID of the child that serviced the request.</td></tr>
128 <tr><td><code>%...{<var>format</var>}P</code></td>
129         <td>The process ID or thread id of the child that serviced the 
130         request.  Valid formats are <code>pid</code> and <code>tid</code>.
131         (<em>Apache 2.0.46 and later</em>)
132         </td></tr>
133 <tr class="odd"><td><code>%...q</code></td>
134         <td>The query string (prepended with a <code>?</code> if a query
135         string exists, otherwise an empty string)</td></tr>
136 <tr><td><code>%...r</code></td>
137         <td>First line of request</td></tr>
138 <tr class="odd"><td><code>%...s</code></td>
139         <td>Status. For requests that got internally redirected, this is
140         the status of the *original* request --- <code>%...&gt;s</code>
141         for the last.</td></tr>
142 <tr><td><code>%...t</code></td>
143         <td>Time the request was received (standard english
144         format)</td></tr>
145 <tr class="odd"><td><code>%...{<var>format</var>}t</code></td>
146         <td>The time, in the form given by format, which should be in
147         <code>strftime(3)</code> format. (potentially localized)</td></tr>
148 <tr><td><code>%...T</code></td>
149         <td>The time taken to serve the request, in seconds.</td></tr>
150 <tr class="odd"><td><code>%...u</code></td>
151         <td>Remote user (from auth; may be bogus if return status
152         (<code>%s</code>) is 401)</td></tr>
153 <tr><td><code>%...U</code></td>
154         <td>The URL path requested, not including any query string.</td></tr>
155 <tr class="odd"><td><code>%...v</code></td>
156         <td>The canonical <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code>
157         of the server serving the request.</td></tr>
158 <tr><td><code>%...V</code></td>
159         <td>The server name according to the <code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> setting.</td></tr>
160 <tr class="odd"><td><code>%...X</code></td>
161         <td>Connection status when response is completed:
162
163         <table>
164         
165         <tr><td><code>X</code> =</td>
166             <td>connection aborted before the response completed.</td></tr>
167         <tr><td><code>+</code> =</td>
168             <td>connection may be kept alive after the response is
169             sent.</td></tr>
170         <tr><td><code>-</code> = </td>
171             <td>connection will be closed after the response is
172             sent.</td></tr>
173         </table>
174
175         <p>(This directive was <code>%...c</code> in late versions of Apache
176         1.3, but this conflicted with the historical ssl
177         <code>%...{<var>var</var>}c</code> syntax.)</p></td></tr>
178 <tr><td><code>%...I</code></td>
179         <td>Bytes received, including request and headers, cannot be zero.
180         You need to enable <code class="module"><a href="../mod/mod_logio.html">mod_logio</a></code> to use this.</td></tr>
181 <tr class="odd"><td><code>%...O</code></td>
182         <td>Bytes sent, including headers, cannot be zero. You need to
183         enable <code class="module"><a href="../mod/mod_logio.html">mod_logio</a></code> to use this.</td></tr>
184 </table>
185
186     <p>The "<var>...</var>" can be nothing at all (<em>e.g.</em>,
187     <code>"%h %u %r %s %b"</code>), or it can indicate conditions for
188     inclusion of the item (which will cause it to be replaced with "-" if
189     the condition is not met). The forms of condition are a list of
190     HTTP status codes, which may or may not be preceded by "!".
191     Thus, "%400,501{User-agent}i" logs <code>User-agent:</code> on 400
192     errors and 501 errors (Bad Request, Not Implemented) only;
193     "%!200,304,302{Referer}i" logs <code>Referer:</code> on all requests
194     which did <em>not</em> return some sort of normal status.</p>
195
196     <p>The modifiers "&lt;" and "&gt;" can be used for requests that
197     have been internally redirected to choose whether the original or
198     final (respectively) request should be consulted.  By default, the
199     <code>%</code> directives <code>%s, %U, %T, %D,</code> and
200     <code>%r</code> look at the original request while all others look
201     at the final request.  So for example, <code>%&gt;s</code> can be
202     used to record the final status of the request and
203     <code>%&lt;u</code> can be used to record the original
204     authenticated user on a request that is internally redirected to an
205     unauthenticated resource.</p>
206
207     <p>Note that in httpd 2.0 versions prior to 2.0.46, no escaping was performed
208     on the strings from <code>%...r</code>, <code>%...i</code> and
209     <code>%...o</code>. This was mainly to comply with the requirements of
210     the Common Log Format. This implied that clients could insert control
211     characters into the log, so you had to be quite careful when dealing
212     with raw log files.</p>
213
214     <p>For security reasons, starting with 2.0.46, non-printable and
215     other special characters are escaped mostly by using
216     <code>\x<var>hh</var></code> sequences, where <var>hh</var> stands for
217     the hexadecimal representation of the raw byte. Exceptions from this
218     rule are <code>"</code> and <code>\</code> which are escaped by prepending
219     a backslash, and all whitespace characters which are written in their
220     C-style notation (<code>\n</code>, <code>\t</code> etc).</p>
221
222     <p>Note that in httpd 2.0, unlike 1.3, the <code>%b</code> and
223     <code>%B</code> format strings do not represent the number of
224     bytes sent to the client, but simply the size in bytes of the HTTP
225     response (which will differ, for instance, if the connection is
226     aborted, or if SSL is used).  The <code>%O</code> format provided
227     by <code class="module"><a href="../mod/mod_logio.html">mod_logio</a></code> will log the actual number of bytes
228     sent over the network.</p>
229
230     <p>Some commonly used log format strings are:</p>
231
232     <dl>
233       <dt>Common Log Format (CLF)</dt>
234       <dd><code>"%h %l %u %t \"%r\" %&gt;s %b"</code></dd>
235
236       <dt>Common Log Format with Virtual Host</dt>
237       <dd><code>"%v %h %l %u %t \"%r\" %&gt;s %b"</code></dd>
238
239       <dt>NCSA extended/combined log format</dt>
240       <dd><code>"%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\"
241       \"%{User-agent}i\""</code></dd>
242
243       <dt>Referer log format</dt>
244       <dd><code>"%{Referer}i -&gt; %U"</code></dd>
245
246       <dt>Agent (Browser) log format</dt>
247       <dd><code>"%{User-agent}i"</code></dd>
248     </dl>
249
250     <p>Note that the canonical <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code> and <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code> of the server serving the
251     request are used for <code>%v</code> and <code>%p</code>
252     respectively. This happens regardless of the <code class="directive"><a href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> setting
253     because otherwise log analysis programs would have to duplicate
254     the entire vhost matching algorithm in order to decide what
255     host really served the request.</p>
256 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
257 <div class="section">
258 <h2><a name="security" id="security">Security Considerations</a></h2>
259     <p>See the <a href="../misc/security_tips.html#serverroot">security tips</a>
260     document for details on why your security could be compromised
261     if the directory where logfiles are stored is writable by
262     anyone other than the user that starts the server.</p>
263 </div>
264 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
265 <div class="directive-section"><h2><a name="BufferedLogs" id="BufferedLogs">BufferedLogs</a> <a name="bufferedlogs" id="bufferedlogs">Directive</a></h2>
266 <table class="directive">
267 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Buffer log entries in memory before writing to disk</td></tr>
268 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>BufferedLogs On|Off</code></td></tr>
269 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>BufferedLogs Off</code></td></tr>
270 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
271 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
272 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_config</td></tr>
273 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in versions 2.0.41 and later.</td></tr>
274 </table>
275     <p>The <code class="directive">BufferedLogs</code> directive causes
276     <code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code> to store several log entries in
277     memory and write them together to disk, rather than writing them
278     after each request.  On some systems, this may result in more
279     efficient disk access and hence higher performance.  It may be
280     set only once for the entire server; it cannot be configured
281     per virtual-host.</p>
282
283     <div class="note">This directive is experimental and should be used with
284     caution.</div>
285
286 </div>
287 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
288 <div class="directive-section"><h2><a name="CookieLog" id="CookieLog">CookieLog</a> <a name="cookielog" id="cookielog">Directive</a></h2>
289 <table class="directive">
290 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets filename for the logging of cookies</td></tr>
291 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CookieLog <var>filename</var></code></td></tr>
292 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
293 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
294 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_config</td></tr>
295 <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>This directive is deprecated.</td></tr>
296 </table>
297     <p>The <code class="directive">CookieLog</code> directive sets the 
298     filename for logging of cookies. The filename is relative to the
299     <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>. This directive is
300     included only for compatibility with <code>mod_cookies</code>,
301     and is deprecated.</p>
302
303 </div>
304 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
305 <div class="directive-section"><h2><a name="CustomLog" id="CustomLog">CustomLog</a> <a name="customlog" id="customlog">Directive</a></h2>
306 <table class="directive">
307 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets filename and format of log file</td></tr>
308 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CustomLog  <var>file</var>|<var>pipe</var>
309 <var>format</var>|<var>nickname</var>
310 [env=[!]<var>environment-variable</var>]</code></td></tr>
311 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
312 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
313 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_config</td></tr>
314 </table>
315     <p>The <code class="directive">CustomLog</code> directive is used to
316     log requests to the server. A log format is specified, and the
317     logging can optionally be made conditional on request
318     characteristics using environment variables.</p>
319
320     <p>The first argument, which specifies the location to which
321     the logs will be written, can take one of the following two
322     types of values:</p>
323
324     <dl>
325       <dt><var>file</var></dt>
326       <dd>A filename, relative to the <code class="directive"><a href="../mod/core.html#serverroot">ServerRoot</a></code>.</dd>
327
328       <dt><var>pipe</var></dt>
329       <dd>The pipe character "<code>|</code>", followed by the path
330       to a program to receive the log information on its standard
331       input.
332
333       <div class="warning"><h3>Security:</h3>
334       <p>If a program is used, then it will be run as the user who
335       started <code class="program"><a href="../programs/httpd.html">httpd</a></code>. This will be root if the server was
336       started by root; be sure that the program is secure.</p>
337       </div>
338       <div class="warning"><h3>Note</h3>
339         <p>When entering a file path on non-Unix platforms, care should be taken
340         to make sure that only forward slashed are used even though the platform
341         may allow the use of back slashes. In general it is a good idea to always 
342         use forward slashes throughout the configuration files.</p>
343       </div></dd>
344     </dl>
345
346     <p>The second argument specifies what will be written to the
347     log file. It can specify either a <var>nickname</var> defined by
348     a previous <code class="directive"><a href="#logformat">LogFormat</a></code>
349     directive, or it can be an explicit <var>format</var> string as
350     described in the <a href="#formats">log formats</a> section.</p>
351
352     <p>For example, the following two sets of directives have
353     exactly the same effect:</p>
354
355     <div class="example"><p><code>
356       # CustomLog with format nickname<br />
357       LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common<br />
358       CustomLog logs/access_log common<br />
359       <br />
360       # CustomLog with explicit format string<br />
361       CustomLog logs/access_log "%h %l %u %t \"%r\" %&gt;s %b"
362     </code></p></div>
363
364     <p>The third argument is optional and controls whether or
365     not to log a particular request based on the
366     presence or absence of a particular variable in the server
367     environment. If the specified <a href="../env.html">environment
368     variable</a> is set for the request (or is not set, in the case
369     of a '<code>env=!<var>name</var></code>' clause), then the
370     request will be logged.</p>
371
372     <p>Environment variables can be set on a per-request
373     basis using the <code class="module"><a href="../mod/mod_setenvif.html">mod_setenvif</a></code>
374     and/or <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> modules. For
375     example, if you want to record requests for all GIF
376     images on your server in a separate logfile but not in your main
377     log, you can use:</p>
378     
379     <div class="example"><p><code>
380       SetEnvIf Request_URI \.gif$ gif-image<br />
381       CustomLog gif-requests.log common env=gif-image<br />
382       CustomLog nongif-requests.log common env=!gif-image
383     </code></p></div>
384
385     <p>Or, to reproduce the behavior of the old RefererIgnore
386     directive, you might use the following:</p>
387
388     <div class="example"><p><code>
389     SetEnvIf Referer example\.com localreferer<br />
390     CustomLog referer.log referer env=!localreferer
391     </code></p></div>
392
393 </div>
394 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
395 <div class="directive-section"><h2><a name="LogFormat" id="LogFormat">LogFormat</a> <a name="logformat" id="logformat">Directive</a></h2>
396 <table class="directive">
397 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Describes a format for use in a log file</td></tr>
398 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogFormat <var>format</var>|<var>nickname</var>
399 [<var>nickname</var>]</code></td></tr>
400 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogFormat "%h %l %u %t \"%r\" %&gt;s %b"</code></td></tr>
401 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
402 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
403 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_config</td></tr>
404 </table>
405     <p>This directive specifies the format of the access log
406     file.</p>
407
408     <p>The <code class="directive">LogFormat</code> directive can take one of two
409     forms. In the first form, where only one argument is specified,
410     this directive sets the log format which will be used by logs
411     specified in subsequent <code class="directive">TransferLog</code>
412     directives. The single argument can specify an explicit
413     <var>format</var> as discussed in the <a href="#formats">custom log
414     formats</a> section above. Alternatively, it can use a
415     <var>nickname</var> to refer to a log format defined in a
416     previous <code class="directive">LogFormat</code> directive as described
417     below.</p>
418
419     <p>The second form of the <code class="directive">LogFormat</code> 
420     directive associates an explicit <var>format</var> with a
421     <var>nickname</var>. This <var>nickname</var> can then be used in
422     subsequent <code class="directive">LogFormat</code> or
423     <code class="directive"><a href="#customlog">CustomLog</a></code> directives
424     rather than repeating the entire format string. A
425     <code class="directive">LogFormat</code> directive that defines a nickname
426     <strong>does nothing else</strong> -- that is, it <em>only</em>
427     defines the nickname, it doesn't actually apply the format and make
428     it the default. Therefore, it will not affect subsequent
429     <code class="directive"><a href="#transferlog">TransferLog</a></code> directives.
430     In addition, <code class="directive">LogFormat</code> cannot use one nickname
431     to define another nickname. Note that the nickname should not contain
432     percent signs (<code>%</code>).</p>
433
434     <div class="example"><h3>Example</h3><p><code>
435       LogFormat "%v %h %l %u %t \"%r\" %&gt;s %b" vhost_common
436     </code></p></div>
437
438 </div>
439 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
440 <div class="directive-section"><h2><a name="TransferLog" id="TransferLog">TransferLog</a> <a name="transferlog" id="transferlog">Directive</a></h2>
441 <table class="directive">
442 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify location of a log file</td></tr>
443 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TransferLog <var>file</var>|<var>pipe</var></code></td></tr>
444 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
445 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Base</td></tr>
446 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_log_config</td></tr>
447 </table>
448     <p>This directive has exactly the same arguments and effect as
449     the <code class="directive"><a href="#customlog">CustomLog</a></code>
450     directive, with the exception that it does not allow the log format
451     to be specified explicitly or for conditional logging of requests.
452     Instead, the log format is determined by the most recently specified
453     <code class="directive"><a href="#logformat">LogFormat</a></code> directive
454     which does not define a nickname. Common Log Format is used if no
455     other format has been specified.</p>
456
457     <div class="example"><h3>Example</h3><p><code>
458       LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\""<br />
459       TransferLog logs/access_log
460     </code></p></div>
461
462 </div>
463 </div>
464 <div class="bottomlang">
465 <p><span>Available Languages: </span><a href="../en/mod/mod_log_config.html" title="English">&nbsp;en&nbsp;</a> |
466 <a href="../ja/mod/mod_log_config.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
467 <a href="../ko/mod/mod_log_config.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
468 <a href="../tr/mod/mod_log_config.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
469 </div><div id="footer">
470 <p class="apache">Copyright 2009 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>
471 <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>
472 </body></html>