logs.html.en revision 6f2da570fbdaa19879beb706c7bdd173ee77131b
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive This file is generated from xml source: DO NOT EDIT
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<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>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<div class="up"><a href="./"><img title="<-" alt="<-" src="/images/left.gif" /></a></div>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="./">Version 2.3</a></div><div id="page-content"><div id="preamble"><h1>Log Files</h1>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<p><span>Available Languages: </span><a href="/en/logs.html" title="English"> en </a> |
a63f0ab647ad2ab72efc9bea7a66e24e9ebc5cc2nd<a href="/fr/logs.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<a href="/ja/logs.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd<a href="/ko/logs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
4aa805f8500255bc52a4c03259fe46df10a1d07cyoshiki<a href="/tr/logs.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p>
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi <p>In order to effectively manage a web server, it is necessary
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi to get feedback about the activity and performance of the
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd server as well as any problems that may be occurring. The Apache HTTP Server
fe64b2ba25510d8c9dba5560a2d537763566cf40nd provides very comprehensive and flexible logging
fe64b2ba25510d8c9dba5560a2d537763566cf40nd capabilities. This document describes how to configure its
fe64b2ba25510d8c9dba5560a2d537763566cf40nd logging capabilities, and how to understand what the logs
fe64b2ba25510d8c9dba5560a2d537763566cf40nd contain.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#overview">Overview</a></li>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<li><img alt="" src="/images/down.gif" /> <a href="#security">Security Warning</a></li>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<li><img alt="" src="/images/down.gif" /> <a href="#errorlog">Error Log</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#accesslog">Access Log</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#rotation">Log Rotation</a></li>
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd<li><img alt="" src="/images/down.gif" /> <a href="#piped">Piped Logs</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#virtualhost">Virtual Hosts</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<li><img alt="" src="/images/down.gif" /> <a href="#other">Other Log Files</a></li>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code></li><li><code class="module"><a href="/mod/mod_log_forensic.html">mod_log_forensic</a></code></li><li><code class="module"><a href="/mod/mod_logio.html">mod_logio</a></code></li><li><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></li><li><code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code></li></ul></td><td /></tr></table>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd The Apache HTTP Server provides a variety of different mechanisms for
117c1f888a14e73cdd821dc6c23eb0411144a41cnd logging everything that happens on your server, from the initial
29b517f9fe7f32a2c3fbdc53e359b6db6f8e8c2csf request, through the URL mapping process, to the final resolution of
e797af4d7b0cada1278d72d6c8ac77210ef78632minfrin the connection, including any errors that may have occurred in the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd process. In addition to this, third-party modules may provide logging
117c1f888a14e73cdd821dc6c23eb0411144a41cnd capabilities, or inject entries into the existing log files, and
117c1f888a14e73cdd821dc6c23eb0411144a41cnd applications such as CGI programs, or PHP scripts, or other handlers,
117c1f888a14e73cdd821dc6c23eb0411144a41cnd may send messages to the server error log.
117c1f888a14e73cdd821dc6c23eb0411144a41cnd In this document we discuss the logging modules that are a standard
117c1f888a14e73cdd821dc6c23eb0411144a41cnd part of the http server.
117c1f888a14e73cdd821dc6c23eb0411144a41cnd </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd<h2><a name="security" id="security">Security Warning</a></h2>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <p>Anyone who can write to the directory where Apache httpd is
117c1f888a14e73cdd821dc6c23eb0411144a41cnd writing a log file can almost certainly gain access to the uid
117c1f888a14e73cdd821dc6c23eb0411144a41cnd that the server is started as, which is normally root. Do
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <em>NOT</em> give people write access to the directory the logs
117c1f888a14e73cdd821dc6c23eb0411144a41cnd are stored in without being aware of the consequences; see the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <a href="misc/security_tips.html">security tips</a> document
117c1f888a14e73cdd821dc6c23eb0411144a41cnd for details.</p>
709e3a21ba73b8433462959cd56c773454b34441trawick <p>In addition, log files may contain information supplied
117c1f888a14e73cdd821dc6c23eb0411144a41cnd directly by the client, without escaping. Therefore, it is
117c1f888a14e73cdd821dc6c23eb0411144a41cnd possible for malicious clients to insert control-characters in
9f19223e8fb7b99f5f1cc02c8c3c2c6567793262rbowen the log files, so care must be taken in dealing with raw
117c1f888a14e73cdd821dc6c23eb0411144a41cnd </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/core.html">core</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code></li><li><code class="directive"><a href="/mod/core.html#errorlogformat">ErrorLogFormat</a></code></li><li><code class="directive"><a href="/mod/core.html#loglevel">LogLevel</a></code></li></ul></td></tr></table>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <p>The server error log, whose name and location is set by the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code> directive, is the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd most important log file. This is the place where Apache httpd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd will send diagnostic information and record any errors that it
117c1f888a14e73cdd821dc6c23eb0411144a41cnd encounters in processing requests. It is the first place to
117c1f888a14e73cdd821dc6c23eb0411144a41cnd look when a problem occurs with starting the server or with the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd operation of the server, since it will often contain details of
117c1f888a14e73cdd821dc6c23eb0411144a41cnd what went wrong and how to fix it.</p>
e797af4d7b0cada1278d72d6c8ac77210ef78632minfrin <p>The error log is usually written to a file (typically
a38b5f73e7f0f3b8726fb47d27b145f37036ead0jim <code>error.log</code> on Windows and OS/2). On Unix systems it
117c1f888a14e73cdd821dc6c23eb0411144a41cnd is also possible to have the server send errors to
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>The format of the error log is relatively free-form and
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna descriptive. But there is certain information that is contained
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna in most error log entries. For example, here is a typical
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna message.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna [Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1]
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna client denied by server configuration:
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen <p>The first item in the log entry is the date and time of the
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen message. The second item lists the severity of the error being
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen reported. The <code class="directive"><a href="/mod/core.html#loglevel">LogLevel</a></code>
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen directive is used to control the types of errors that are sent
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen to the error log by restricting the severity level. The third
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor item gives the IP address of the client that generated the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe error. Beyond that is the message itself, which in this case
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe indicates that the server has been configured to deny the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe client access. The server reports the file-system path (as
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor opposed to the web path) of the requested document.</p>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>A very wide variety of different messages can appear in the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe error log. Most look similar to the example above. The error
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna log will also contain debugging output from CGI scripts. Any
6fad623c3cc52b4a84d4d36538f6eed886f49f98covener information written to <code>stderr</code> by a CGI script will
6fad623c3cc52b4a84d4d36538f6eed886f49f98covener be copied directly to the error log.</p>
6fad623c3cc52b4a84d4d36538f6eed886f49f98covener <p>It is not possible to customize the error log by adding or
6fad623c3cc52b4a84d4d36538f6eed886f49f98covener removing information. However, error log entries dealing with
6fad623c3cc52b4a84d4d36538f6eed886f49f98covener particular requests have corresponding entries in the <a href="#accesslog">access log</a>. For example, the above example
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna entry corresponds to an access log entry with status code 403.
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna Since it is possible to customize the access log, you can
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna obtain more information about error conditions using that log
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor <p>During testing, it is often useful to continuously monitor
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna the error log for any problems. On Unix systems, you can
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor accomplish this using:</p>
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor tail -f error_log
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna<h2><a name="accesslog" id="accesslog">Access Log</a></h2>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code></li><li><code class="module"><a href="/mod/mod_setenvif.html">mod_setenvif</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code></li><li><code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code></li><li><code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code></li></ul></td></tr></table>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <p>The server access log records all requests processed by the
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna server. The location and content of the access log are
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor controlled by the <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna directive. The <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code>
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor directive can be used to simplify the selection of
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna the contents of the logs. This section describes how to configure the server
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna to record information in the access log.</p>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>Of course, storing the information in the access log is only
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe the start of log management. The next step is to analyze this
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe information to produce useful statistics. Log analysis in
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe general is beyond the scope of this document, and not really
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe part of the job of the web server itself. For more information
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe about this topic, and for applications which perform log
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe analysis, check the <a href="http://dmoz.org/Computers/Software/Internet/Site_Management/Log_analysis/">
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe Open Directory</a> or <a href="http://dir.yahoo.com/Computers_and_Internet/Software/Internet/World_Wide_Web/Servers/Log_Analysis_Tools/">
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>Various versions of Apache httpd have used other modules and
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe directives to control access logging, including
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe mod_log_referer, mod_log_agent, and the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <code>TransferLog</code> directive. The <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> directive now subsumes
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe the functionality of all the older directives.</p>
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe <p>The format of the access log is highly configurable. The format
d972e4a0688f66b1402473dd9dacfecefa2132a8rbowen is specified using a format string that looks much like a C-style
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe printf(1) format string. Some examples are presented in the next
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe sections. For a complete list of the possible contents of the
5ae609a8a09239d20f48a4a95c4f21b713995babwrowe format string, see the <code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code> <a href="mod/mod_log_config.html#formats">format strings</a>.</p>
7e8f5c6496b3825b6b128e2aacc4b1b09d28553dpquerna <h3><a name="common" id="common">Common Log Format</a></h3>
9f19223e8fb7b99f5f1cc02c8c3c2c6567793262rbowen <p>A typical configuration for the access log might look as
9f19223e8fb7b99f5f1cc02c8c3c2c6567793262rbowen follows.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd LogFormat "%h %l %u %t \"%r\" %>s %b" common<br />
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>This defines the <em>nickname</em> <code>common</code> and
fe64b2ba25510d8c9dba5560a2d537763566cf40nd associates it with a particular log format string. The format
fe64b2ba25510d8c9dba5560a2d537763566cf40nd string consists of percent directives, each of which tell the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd server to log a particular piece of information. Literal
fe64b2ba25510d8c9dba5560a2d537763566cf40nd characters may also be placed in the format string and will be
fe64b2ba25510d8c9dba5560a2d537763566cf40nd copied directly into the log output. The quote character
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen (<code>"</code>) must be escaped by placing a backslash before
fe64b2ba25510d8c9dba5560a2d537763566cf40nd it to prevent it from being interpreted as the end of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive format string. The format string may also contain the special
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
fb77c505254b6e9c925e23e734463e87574f8f40kess directive sets up a new log file using the defined
fb77c505254b6e9c925e23e734463e87574f8f40kess <em>nickname</em>. The filename for the access log is relative to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive the <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> unless it
06ba4a61654b3763ad65f52283832ebf058fdf1cslive begins with a slash.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The above configuration will write log entries in a format
06ba4a61654b3763ad65f52283832ebf058fdf1cslive known as the Common Log Format (CLF). This standard format can
06ba4a61654b3763ad65f52283832ebf058fdf1cslive be produced by many different web servers and read by many log
fb77c505254b6e9c925e23e734463e87574f8f40kess analysis programs. The log file entries produced in CLF will
06ba4a61654b3763ad65f52283832ebf058fdf1cslive look something like this:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Each part of this log entry is described below.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <dd>This is the IP address of the client (remote host) which
06ba4a61654b3763ad65f52283832ebf058fdf1cslive made the request to the server. If <code class="directive"><a href="/mod/core.html#hostnamelookups">HostnameLookups</a></code> is
fb77c505254b6e9c925e23e734463e87574f8f40kess set to <code>On</code>, then the server will try to determine
fb77c505254b6e9c925e23e734463e87574f8f40kess the hostname and log it in place of the IP address. However,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive this configuration is not recommended since it can
fb77c505254b6e9c925e23e734463e87574f8f40kess significantly slow the server. Instead, it is best to use a
bc4b55ec8f31569d606d5680d50189a355bcd7a6rbowen log post-processor such as <code class="program"><a href="/programs/logresolve.html">logresolve</a></code> to determine
fb77c505254b6e9c925e23e734463e87574f8f40kess the hostnames. The IP address reported here is not
06ba4a61654b3763ad65f52283832ebf058fdf1cslive necessarily the address of the machine at which the user is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive sitting. If a proxy server exists between the user and the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive server, this address will be the address of the proxy, rather
06ba4a61654b3763ad65f52283832ebf058fdf1cslive than the originating machine.</dd>
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>The "hyphen" in the output indicates that the requested
fb77c505254b6e9c925e23e734463e87574f8f40kess piece of information is not available. In this case, the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive information that is not available is the RFC 1413 identity of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd the client determined by <code>identd</code> on the clients
130d299c4b2b15be45532a176604c71fdc7bea5bnd machine. This information is highly unreliable and should
130d299c4b2b15be45532a176604c71fdc7bea5bnd almost never be used except on tightly controlled internal
130d299c4b2b15be45532a176604c71fdc7bea5bnd networks. Apache httpd will not even attempt to determine
130d299c4b2b15be45532a176604c71fdc7bea5bnd this information unless <code class="directive"><a href="/mod/core.html#identitycheck">IdentityCheck</a></code> is set
130d299c4b2b15be45532a176604c71fdc7bea5bnd <dd>This is the userid of the person requesting the document
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd as determined by HTTP authentication. The same value is
fe64b2ba25510d8c9dba5560a2d537763566cf40nd typically provided to CGI scripts in the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <code>REMOTE_USER</code> environment variable. If the status
fe64b2ba25510d8c9dba5560a2d537763566cf40nd code for the request (see below) is 401, then this value
fe64b2ba25510d8c9dba5560a2d537763566cf40nd should not be trusted because the user is not yet
fe64b2ba25510d8c9dba5560a2d537763566cf40nd authenticated. If the document is not password protected,
fe64b2ba25510d8c9dba5560a2d537763566cf40nd this part will be "<code>-</code>" just like the previous
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess The time that the request was received.
ff797e743eb73c1d45b08158aa6b288c2d0c46eeslive The format is:
06ba4a61654b3763ad65f52283832ebf058fdf1cslive day = 2*digit<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd month = 3*letter<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd year = 4*digit<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd hour = 2*digit<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive minute = 2*digit<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive second = 2*digit<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive zone = (`+' | `-') 4*digit</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>It is possible to have the time displayed in another format
06ba4a61654b3763ad65f52283832ebf058fdf1cslive by specifying <code>%{format}t</code> in the log format
130d299c4b2b15be45532a176604c71fdc7bea5bnd or one of the supported special tokens. For details see
130d299c4b2b15be45532a176604c71fdc7bea5bnd the <code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code> <a href="mod/mod_log_config.html#formats">format strings</a>.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <dd>The request line from the client is given in double
fe64b2ba25510d8c9dba5560a2d537763566cf40nd quotes. The request line contains a great deal of useful
fe64b2ba25510d8c9dba5560a2d537763566cf40nd information. First, the method used by the client is
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <code>GET</code>. Second, the client requested the resource
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <code>/apache_pb.gif</code>, and third, the client used the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd protocol <code>HTTP/1.0</code>. It is also possible to log
fe64b2ba25510d8c9dba5560a2d537763566cf40nd one or more parts of the request line independently. For
fe64b2ba25510d8c9dba5560a2d537763566cf40nd example, the format string "<code>%m %U%q %H</code>" will log
fe64b2ba25510d8c9dba5560a2d537763566cf40nd the method, path, query-string, and protocol, resulting in
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <dd>This is the status code that the server sends back to the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd client. This information is very valuable, because it reveals
fe64b2ba25510d8c9dba5560a2d537763566cf40nd whether the request resulted in a successful response (codes
fe64b2ba25510d8c9dba5560a2d537763566cf40nd beginning in 2), a redirection (codes beginning in 3), an
fe64b2ba25510d8c9dba5560a2d537763566cf40nd error caused by the client (codes beginning in 4), or an
fe64b2ba25510d8c9dba5560a2d537763566cf40nd error in the server (codes beginning in 5). The full list of
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd possible status codes can be found in the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.txt">HTTP
888b616027180cc8aaa4d2bee5ecc6acec175bc5nd <dd>The last part indicates the size of the object returned
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd to the client, not including the response headers. If no
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd content was returned to the client, this value will be
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd "<code>-</code>". To log "<code>0</code>" for no content, use
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <h3><a name="combined" id="combined">Combined Log Format</a></h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Another commonly used format string is called the Combined
fe64b2ba25510d8c9dba5560a2d537763566cf40nd Log Format. It can be used as follows.</p>
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd \"%{User-agent}i\"" combined<br />
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd <p>This format is exactly the same as the Common Log Format,
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd with the addition of two more fields. Each of the additional
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd fields uses the percent-directive
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd <code>%{<em>header</em>}i</code>, where <em>header</em> can be
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd any HTTP request header. The access log under this format will
5224ff8eae5156a05f676f1dad8add2e2f2efe1dnd look like:</p>
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd (Win98; I ;Nav)"
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd <dd>The "Referer" (sic) HTTP request header. This gives the
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd site that the client reports having been referred from. (This
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd should be the page that links to or includes
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd <dd>The User-Agent HTTP request header. This is the
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd identifying information that the client browser reports about
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd itself.</dd>
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd <h3><a name="multiple" id="multiple">Multiple Access Logs</a></h3>
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd <p>Multiple access logs can be created simply by specifying
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd multiple <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd directives in the configuration
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd file. For example, the following directives will create three
4335f1cbf345c91bb996eec540c11ba8ce5d4268nd access logs. The first contains the basic CLF information,
fe64b2ba25510d8c9dba5560a2d537763566cf40nd while the second and third contain referer and browser
fe64b2ba25510d8c9dba5560a2d537763566cf40nd information. The last two <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> lines show how
fe64b2ba25510d8c9dba5560a2d537763566cf40nd to mimic the effects of the <code>ReferLog</code> and <code>AgentLog</code> directives.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd LogFormat "%h %l %u %t \"%r\" %>s %b" common<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>This example also shows that it is not necessary to define a
fb77c505254b6e9c925e23e734463e87574f8f40kess nickname with the <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code> directive. Instead,
fb77c505254b6e9c925e23e734463e87574f8f40kess the log format can be specified directly in the <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> directive.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <h3><a name="conditional" id="conditional">Conditional Logs</a></h3>
ed0dae472b518c553c923a86fb4322d4c50d86a6nd <p>There are times when it is convenient to exclude certain
ed0dae472b518c553c923a86fb4322d4c50d86a6nd entries from the access logs based on characteristics of the
10673857794a4b3d9568ca2d983722a87ed352f1rbowen client request. This is easily accomplished with the help of <a href="env.html">environment variables</a>. First, an
10673857794a4b3d9568ca2d983722a87ed352f1rbowen environment variable must be set to indicate that the request
06ba4a61654b3763ad65f52283832ebf058fdf1cslive meets certain conditions. This is usually accomplished with
fb77c505254b6e9c925e23e734463e87574f8f40kess <code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>. Then the
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>env=</code> clause of the <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> directive is used to
fb77c505254b6e9c925e23e734463e87574f8f40kess include or exclude requests where the environment variable is
06ba4a61654b3763ad65f52283832ebf058fdf1cslive set. Some examples:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess # Mark requests from the loop-back interface<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive SetEnvIf Request_URI "^/robots\.txt$" dontlog<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive # Log what remains<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>As another example, consider logging requests from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive english-speakers to one log file, and non-english speakers to a
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz different log file.</p>
9335f6d807d76d60e54af4ededdebebddb3e3d13noodl SetEnvIf Accept-Language "en" english<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>In a caching scenario one would want to know about
604c89126c27104f659d7a51b0113e3bd435faf8fielding the efficiency of the cache. A very simple method to
604c89126c27104f659d7a51b0113e3bd435faf8fielding find this out would be:</p>
604c89126c27104f659d7a51b0113e3bd435faf8fielding SetEnv CACHE_MISS 1<br />
604c89126c27104f659d7a51b0113e3bd435faf8fielding LogFormat "%h %l %u %t "%r " %>s %b %{CACHE_MISS}e" common-cache<br />
909ce17e2bd0faef7b1c294f2307f009793fd493nd <p><code class="module"><a href="/mod/mod_cache.html">mod_cache</a></code> will run before
909ce17e2bd0faef7b1c294f2307f009793fd493nd <code class="module"><a href="/mod/mod_env.html">mod_env</a></code> and when successfull will deliver the
909ce17e2bd0faef7b1c294f2307f009793fd493nd content without it. In that case a cache hit will log
909ce17e2bd0faef7b1c294f2307f009793fd493nd <code>-</code>, while a cache miss will log <code>1</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Although we have just shown that conditional logging is very
06ba4a61654b3763ad65f52283832ebf058fdf1cslive powerful and flexible, it is not the only way to control the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive contents of the logs. Log files are more useful when they
06ba4a61654b3763ad65f52283832ebf058fdf1cslive contain a complete record of server activity. It is often
97a9a944b5887e91042b019776c41d5dd74557aferikabele easier to simply post-process the log files to remove requests
97a9a944b5887e91042b019776c41d5dd74557aferikabele that you do not want to consider.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<h2><a name="rotation" id="rotation">Log Rotation</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>On even a moderately busy server, the quantity of
cb3a1082aec4b3b4f4ed238c93c3cc54933a7f0end information stored in the log files is very large. The access
06ba4a61654b3763ad65f52283832ebf058fdf1cslive log file typically grows 1 MB or more per 10,000 requests. It
8e31885fc494b603e0650113dde9e29d1b1d2602maczniak will consequently be necessary to periodically rotate the log
06ba4a61654b3763ad65f52283832ebf058fdf1cslive files by moving or deleting the existing logs. This cannot be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive done while the server is running, because Apache httpd will continue
06ba4a61654b3763ad65f52283832ebf058fdf1cslive writing to the old log file as long as it holds the file open.
97a9a944b5887e91042b019776c41d5dd74557aferikabele Instead, the server must be <a href="stopping.html">restarted</a> after the log files are
8e31885fc494b603e0650113dde9e29d1b1d2602maczniak moved or deleted so that it will open new log files.</p>
f23fb63b05f89f47d7a3099491f2c68dcce432e9kess <p>By using a <em>graceful</em> restart, the server can be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive instructed to open new log files without losing any existing or
06ba4a61654b3763ad65f52283832ebf058fdf1cslive pending connections from clients. However, in order to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive accomplish this, the server must continue to write to the old
06ba4a61654b3763ad65f52283832ebf058fdf1cslive log files while it finishes serving old requests. It is
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd therefore necessary to wait for some time after the restart
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd before doing any processing on the log files. A typical
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd scenario that simply rotates the logs and compresses the old
fe64b2ba25510d8c9dba5560a2d537763566cf40nd logs to save space is:</p>
da637bcae7b6e150470e701af29da5604a34a17erbowen apachectl graceful<br />
031bbbc0d1189b07330e38d0c126820a9ab7795egryzor sleep 600<br />
da637bcae7b6e150470e701af29da5604a34a17erbowen <p>Another way to perform log rotation is using <a href="#piped">piped logs</a> as discussed in the next
da637bcae7b6e150470e701af29da5604a34a17erbowen section.</p>
da637bcae7b6e150470e701af29da5604a34a17erbowen </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>Apache httpd is capable of writing error and access log
fe64b2ba25510d8c9dba5560a2d537763566cf40nd files through a pipe to another process, rather than directly
fe64b2ba25510d8c9dba5560a2d537763566cf40nd to a file. This capability dramatically increases the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd flexibility of logging, without adding code to the main server.
fe64b2ba25510d8c9dba5560a2d537763566cf40nd In order to write logs to a pipe, simply replace the filename
fe64b2ba25510d8c9dba5560a2d537763566cf40nd with the pipe character "<code>|</code>", followed by the name
fb77c505254b6e9c925e23e734463e87574f8f40kess of the executable which should accept log entries on its
fe64b2ba25510d8c9dba5560a2d537763566cf40nd standard input. The server will start the piped-log process when
fb77c505254b6e9c925e23e734463e87574f8f40kess the server starts, and will restart it if it crashes while the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd server is running. (This last feature is why we can refer to
fe64b2ba25510d8c9dba5560a2d537763566cf40nd this technique as "reliable piped logging".)</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>Piped log processes are spawned by the parent Apache httpd
c985aca104389df30d6ec0a637ce0ccaac904362nd process, and inherit the userid of that process. This means
fe64b2ba25510d8c9dba5560a2d537763566cf40nd that piped log programs usually run as root. It is therefore
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen very important to keep the programs simple and secure.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>One important use of piped logs is to allow log rotation
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess without having to restart the server. The Apache HTTP Server
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess includes a simple program called <code class="program"><a href="/programs/rotatelogs.html">rotatelogs</a></code>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd for this purpose. For example, to rotate the logs every 24 hours, you
fe64b2ba25510d8c9dba5560a2d537763566cf40nd can use:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>Notice that quotes are used to enclose the entire command
fe64b2ba25510d8c9dba5560a2d537763566cf40nd that will be called for the pipe. Although these examples are
fe64b2ba25510d8c9dba5560a2d537763566cf40nd for the access log, the same technique can be used for the
fe64b2ba25510d8c9dba5560a2d537763566cf40nd error log.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>A similar but much more flexible log rotation program
06ba4a61654b3763ad65f52283832ebf058fdf1cslive called <a href="http://www.cronolog.org/">cronolog</a>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive is available at an external site.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>As with conditional logging, piped logs are a very powerful
06ba4a61654b3763ad65f52283832ebf058fdf1cslive tool, but they should not be used where a simpler solution like
06ba4a61654b3763ad65f52283832ebf058fdf1cslive off-line post-processing is available.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>By default the piped log process is spawned without invoking
06ba4a61654b3763ad65f52283832ebf058fdf1cslive a shell. Use "<code>|$</code>" instead of "<code>|</code>"
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to spawn using a shell (usually with <code>/bin/sh -c</code>):</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive # Invoke "rotatelogs" using a shell<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This was the default behaviour for Apache 2.2.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive Depending on the shell specifics this might lead to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive an additional shell process for the lifetime of the logging
06ba4a61654b3763ad65f52283832ebf058fdf1cslive pipe program and signal handling problems during restart.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive For compatibility reasons with Apache 2.2 the notation
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "<code>||</code>" is also supported and equivalent to using
fb77c505254b6e9c925e23e734463e87574f8f40kess </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd<h2><a name="virtualhost" id="virtualhost">Virtual Hosts</a></h2>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>When running a server with many <a href="vhosts/">virtual
fe64b2ba25510d8c9dba5560a2d537763566cf40nd hosts</a>, there are several options for dealing with log
604c89126c27104f659d7a51b0113e3bd435faf8fielding files. First, it is possible to use logs exactly as in a
604c89126c27104f659d7a51b0113e3bd435faf8fielding single-host server. Simply by placing the logging directives
604c89126c27104f659d7a51b0113e3bd435faf8fielding outside the <code class="directive"><a href="/mod/core.html#virtualhost"><VirtualHost></a></code> sections in the
604c89126c27104f659d7a51b0113e3bd435faf8fielding main server context, it is possible to log all requests in the
604c89126c27104f659d7a51b0113e3bd435faf8fielding same access log and error log. This technique does not allow
604c89126c27104f659d7a51b0113e3bd435faf8fielding for easy collection of statistics on individual virtual
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p>If <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd or <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd directives are placed inside a
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen <code class="directive"><a href="/mod/core.html#virtualhost"><VirtualHost></a></code>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd section, all requests or errors for that virtual host will be
604c89126c27104f659d7a51b0113e3bd435faf8fielding logged only to the specified file. Any virtual host which does
604c89126c27104f659d7a51b0113e3bd435faf8fielding not have logging directives will still have its requests sent
604c89126c27104f659d7a51b0113e3bd435faf8fielding to the main server logs. This technique is very useful for a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive small number of virtual hosts, but if the number of hosts is
22265f1724519886e2a2b5e0ebd61477506b7379noodl very large, it can be complicated to manage. In addition, it
22265f1724519886e2a2b5e0ebd61477506b7379noodl can often create problems with <a href="vhosts/fd-limits.html">insufficient file
604c89126c27104f659d7a51b0113e3bd435faf8fielding <p>For the access log, there is a very good compromise. By
604c89126c27104f659d7a51b0113e3bd435faf8fielding adding information on the virtual host to the log format
604c89126c27104f659d7a51b0113e3bd435faf8fielding string, it is possible to log all hosts to the same log, and
604c89126c27104f659d7a51b0113e3bd435faf8fielding later split the log into individual files. For example,
604c89126c27104f659d7a51b0113e3bd435faf8fielding consider the following directives.</p>
604c89126c27104f659d7a51b0113e3bd435faf8fielding LogFormat "%v %l %u %t \"%r\" %>s %b"
604c89126c27104f659d7a51b0113e3bd435faf8fielding comonvhost<br />
9597f440430d8c876dd64f5f78066804650a18ecnoodl <p>The <code>%v</code> is used to log the name of the virtual
9597f440430d8c876dd64f5f78066804650a18ecnoodl host that is serving the request. Then a program like <a href="programs/other.html">split-logfile</a> can be used to
9597f440430d8c876dd64f5f78066804650a18ecnoodl post-process the access log in order to split it into one file
9597f440430d8c876dd64f5f78066804650a18ecnoodl per virtual host.</p>
9597f440430d8c876dd64f5f78066804650a18ecnoodl </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
9597f440430d8c876dd64f5f78066804650a18ecnoodl<h2><a name="other" id="other">Other Log Files</a></h2>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/mod_logio.html">mod_logio</a></code></li><li><code class="module"><a href="/mod/mod_log_forensic.html">mod_log_forensic</a></code></li><li><code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code></li><li><code class="directive"><a href="/mod/mod_log_forensic.html#forensiclog">ForensicLog</a></code></li><li><code class="directive"><a href="/mod/mpm_common.html#pidfile">PidFile</a></code></li><li><code class="directive"><a href="/mod/mod_cgi.html#scriptlog">ScriptLog</a></code></li><li><code class="directive"><a href="/mod/mod_cgi.html#scriptlogbuffer">ScriptLogBuffer</a></code></li><li><code class="directive"><a href="/mod/mod_cgi.html#scriptloglength">ScriptLogLength</a></code></li></ul></td></tr></table>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p><code class="module"><a href="/mod/mod_logio.html">mod_logio</a></code> adds in two additional
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code> fields
fe64b2ba25510d8c9dba5560a2d537763566cf40nd (%I and %O) that log the actual number of bytes received and sent
fe64b2ba25510d8c9dba5560a2d537763566cf40nd on the network.</p>
fe64b2ba25510d8c9dba5560a2d537763566cf40nd <p><code class="module"><a href="/mod/mod_log_forensic.html">mod_log_forensic</a></code> provides for forensic logging of
fe64b2ba25510d8c9dba5560a2d537763566cf40nd client requests. Logging is done before and after processing a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive request, so the forensic log contains two log lines for each
06ba4a61654b3763ad65f52283832ebf058fdf1cslive request. The forensic logger is very strict with no customizations.
cb43ec0a02f97651bf2f46c9f4b9b48d5cb22df7rbowen It can be an invaluable debugging and security tool.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>On startup, Apache httpd saves the process id of the parent
fb77c505254b6e9c925e23e734463e87574f8f40kess httpd process to the file <code>logs/httpd.pid</code>. This
fb77c505254b6e9c925e23e734463e87574f8f40kess filename can be changed with the <code class="directive"><a href="/mod/mpm_common.html#pidfile">PidFile</a></code> directive. The
ff797e743eb73c1d45b08158aa6b288c2d0c46eeslive process-id is for use by the administrator in restarting and
ff797e743eb73c1d45b08158aa6b288c2d0c46eeslive terminating the daemon by sending signals to the parent
ff797e743eb73c1d45b08158aa6b288c2d0c46eeslive process; on Windows, use the -k command line option instead.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd For more information see the <a href="stopping.html">Stopping
130d299c4b2b15be45532a176604c71fdc7bea5bnd <h3><a name="scriptlog" id="scriptlog">Script Log</a></h3>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>In order to aid in debugging, the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code class="directive"><a href="/mod/mod_cgi.html#scriptlog">ScriptLog</a></code> directive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd allows you to record the input to and output from CGI scripts.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd This should only be used in testing - not for live servers.
88d86cfadffe2275a3dfb67a4d7bdc018630b661rbowen More information is available in the <a href="mod/mod_cgi.html">mod_cgi</a> documentation.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<p><span>Available Languages: </span><a href="/en/logs.html" title="English"> en </a> |
b06660a3ed3d885e15d99c0209a46c4657df33fbrbowen<a href="/fr/logs.html" hreflang="fr" rel="alternate" title="Fran�ais"> fr </a> |
d1348237b33bc1755b9f1165eea52317465a7671nd<a href="/ja/logs.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
d1348237b33bc1755b9f1165eea52317465a7671nd<a href="/ko/logs.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<a href="/tr/logs.html" hreflang="tr" rel="alternate" title="T�rk�e"> tr </a></p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<p class="apache">Copyright 2010 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>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<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>