logs.html.en revision 6116c12fdd3ed06d388fe6572e50a22e9320dfa5
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<?xml version="1.0" encoding="ISO-8859-1"?>
8e34905974b7a442a55adac3b3fdb196c389e807takashi<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
640b2adac05bb7f5e9fba064434c91852c3a72e6nd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8e34905974b7a442a55adac3b3fdb196c389e807takashi This file is generated from xml source: DO NOT EDIT
640b2adac05bb7f5e9fba064434c91852c3a72e6nd XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
640b2adac05bb7f5e9fba064434c91852c3a72e6nd -->
8e34905974b7a442a55adac3b3fdb196c389e807takashi<title>Log Files - Apache HTTP Server</title>
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
8e34905974b7a442a55adac3b3fdb196c389e807takashi<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
8e34905974b7a442a55adac3b3fdb196c389e807takashi<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<body id="manual-page"><div id="page-header">
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<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>
8e34905974b7a442a55adac3b3fdb196c389e807takashi<p class="apache">Apache HTTP Server Version 2.1</p>
8e34905974b7a442a55adac3b3fdb196c389e807takashi<img alt="" src="/images/feather.gif" /></div>
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<div id="path">
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<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></div><div id="page-content"><div id="preamble"><h1>Log Files</h1>
640b2adac05bb7f5e9fba064434c91852c3a72e6nd<div class="toplang">
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<p><span>Available Languages: </span><a href="/en/logs.html">&nbsp;en&nbsp;</a> | <a href="/ja/logs.html">&nbsp;ja&nbsp;</a> | <a href="/ko/logs.html">&nbsp;ko&nbsp;</a></p>
8e34905974b7a442a55adac3b3fdb196c389e807takashi</div>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
ef685e00a47967e27d89709461728a229d762172nd <p>In order to effectively manage a web server, it is necessary
ef685e00a47967e27d89709461728a229d762172nd to get feedback about the activity and performance of the
ef685e00a47967e27d89709461728a229d762172nd server as well as any problems that may be occurring. The Apache
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe HTTP Server provides very comprehensive and flexible logging
6bbaaf620dec844488d050f0d484564f08c23383erikabele capabilities. This document describes how to configure its
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe logging capabilities, and how to understand what the logs
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe contain.</p>
51853aa2ebfdf9903a094467e1d02099f143639daaron </div>
51853aa2ebfdf9903a094467e1d02099f143639daaron<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#security">Security Warning</a></li>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<li><img alt="" src="/images/down.gif" /> <a href="#errorlog">Error Log</a></li>
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive<li><img alt="" src="/images/down.gif" /> <a href="#accesslog">Access Log</a></li>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<li><img alt="" src="/images/down.gif" /> <a href="#rotation">Log Rotation</a></li>
81622596373177e079337e956f7a5800895443b3erikabele<li><img alt="" src="/images/down.gif" /> <a href="#piped">Piped Logs</a></li>
ef685e00a47967e27d89709461728a229d762172nd<li><img alt="" src="/images/down.gif" /> <a href="#virtualhost">Virtual Hosts</a></li>
ef685e00a47967e27d89709461728a229d762172nd<li><img alt="" src="/images/down.gif" /> <a href="#other">Other Log Files</a></li>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe</ul></div>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<div class="section">
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<h2><a name="security" id="security">Security Warning</a></h2>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
8e34905974b7a442a55adac3b3fdb196c389e807takashi
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>Anyone who can write to the directory where Apache is
ef685e00a47967e27d89709461728a229d762172nd writing a log file can almost certainly gain access to the uid
ef685e00a47967e27d89709461728a229d762172nd that the server is started as, which is normally root. Do
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <em>NOT</em> give people write access to the directory the logs
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe are stored in without being aware of the consequences; see the
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <a href="misc/security_tips.html">security tips</a> document
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe for details.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>In addition, log files may contain information supplied
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe directly by the client, without escaping. Therefore, it is
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe possible for malicious clients to insert control-characters in
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe the log files, so care must be taken in dealing with raw
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe logs.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<div class="section">
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe<h2><a name="errorlog" id="errorlog">Error Log</a></h2>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
8dc8d968ba5f9e7090a062cce6755221e92ccc3crbowen <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><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#loglevel">LogLevel</a></code></li></ul></td></tr></table>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
17ca00f92106c825382359ebf0a754f8df21e316rbowen <p>The server error log, whose name and location is set by the
8dc8d968ba5f9e7090a062cce6755221e92ccc3crbowen <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code> directive, is the
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe most important log file. This is the place where Apache httpd
8dc8d968ba5f9e7090a062cce6755221e92ccc3crbowen will send diagnostic information and record any errors that it
17ca00f92106c825382359ebf0a754f8df21e316rbowen encounters in processing requests. It is the first place to
17ca00f92106c825382359ebf0a754f8df21e316rbowen look when a problem occurs with starting the server or with the
17ca00f92106c825382359ebf0a754f8df21e316rbowen operation of the server, since it will often contain details of
17ca00f92106c825382359ebf0a754f8df21e316rbowen what went wrong and how to fix it.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>The error log is usually written to a file (typically
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <code>error_log</code> on unix systems and
17ca00f92106c825382359ebf0a754f8df21e316rbowen <code>error.log</code> on Windows and OS/2). On unix systems it
17ca00f92106c825382359ebf0a754f8df21e316rbowen is also possible to have the server send errors to
17ca00f92106c825382359ebf0a754f8df21e316rbowen <code>syslog</code> or <a href="#piped">pipe them to a
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe program</a>.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>The format of the error log is relatively free-form and
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe descriptive. But there is certain information that is contained
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe in most error log entries. For example, here is a typical
8e34905974b7a442a55adac3b3fdb196c389e807takashi message.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
ef685e00a47967e27d89709461728a229d762172nd <div class="example"><p><code>
ef685e00a47967e27d89709461728a229d762172nd [Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1]
ef685e00a47967e27d89709461728a229d762172nd client denied by server configuration:
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe /export/home/live/ap/htdocs/test
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe </code></p></div>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>The first item in the log entry is the date and time of the
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe message. The second entry lists the severity of the error being
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe reported. The <code class="directive"><a href="/mod/core.html#loglevel">LogLevel</a></code>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe directive is used to control the types of errors that are sent
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe to the error log by restricting the severity level. The third
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe entry gives the IP address of the client that generated the
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe error. Beyond that is the message itself, which in this case
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe indicates that the server has been configured to deny the
45220913988eb2543fff442282c4aaa6b20559a8rbowen client access. The server reports the file-system path (as
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe opposed to the web path) of the requested document.</p>
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe <p>A very wide variety of different messages can appear in the
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe error log. Most look similar to the example above. The error
d919a3bee0af8994d55ad9a5f2e899e6fb445913wrowe log will also contain debugging output from CGI scripts. Any
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive information written to <code>stderr</code> by a CGI script will
95e8cab14596a61826fa52477dcaebc07bfbad00colm be copied directly to the error log.</p>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
95e8cab14596a61826fa52477dcaebc07bfbad00colm <p>It is not possible to customize the error log by adding or
95e8cab14596a61826fa52477dcaebc07bfbad00colm removing information. However, error log entries dealing with
95e8cab14596a61826fa52477dcaebc07bfbad00colm particular requests have corresponding entries in the <a href="#accesslog">access log</a>. For example, the above example
95e8cab14596a61826fa52477dcaebc07bfbad00colm entry corresponds to an access log entry with status code 403.
95e8cab14596a61826fa52477dcaebc07bfbad00colm Since it is possible to customize the access log, you can
95e8cab14596a61826fa52477dcaebc07bfbad00colm obtain more information about error conditions using that log
95e8cab14596a61826fa52477dcaebc07bfbad00colm file.</p>
95e8cab14596a61826fa52477dcaebc07bfbad00colm
95e8cab14596a61826fa52477dcaebc07bfbad00colm <p>During testing, it is often useful to continuously monitor
95e8cab14596a61826fa52477dcaebc07bfbad00colm the error log for any problems. On unix systems, you can
95e8cab14596a61826fa52477dcaebc07bfbad00colm accomplish this using:</p>
95e8cab14596a61826fa52477dcaebc07bfbad00colm
95e8cab14596a61826fa52477dcaebc07bfbad00colm <div class="example"><p><code>
95e8cab14596a61826fa52477dcaebc07bfbad00colm tail -f error_log
95e8cab14596a61826fa52477dcaebc07bfbad00colm </code></p></div>
95e8cab14596a61826fa52477dcaebc07bfbad00colm </div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
95e8cab14596a61826fa52477dcaebc07bfbad00colm<div class="section">
95e8cab14596a61826fa52477dcaebc07bfbad00colm<h2><a name="accesslog" id="accesslog">Access Log</a></h2>
95e8cab14596a61826fa52477dcaebc07bfbad00colm
95e8cab14596a61826fa52477dcaebc07bfbad00colm
95e8cab14596a61826fa52477dcaebc07bfbad00colm <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>
95e8cab14596a61826fa52477dcaebc07bfbad00colm
17efa6b5344b7574597eec03f02ef28103e19265nd <p>The server access log records all requests processed by the
8e34905974b7a442a55adac3b3fdb196c389e807takashi server. The location and content of the access log are
17efa6b5344b7574597eec03f02ef28103e19265nd controlled by the <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
17efa6b5344b7574597eec03f02ef28103e19265nd directive. The <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code>
17efa6b5344b7574597eec03f02ef28103e19265nd directive can be used to simplify the selection of
17efa6b5344b7574597eec03f02ef28103e19265nd the contents of the logs. This section describes how to configure the server
17efa6b5344b7574597eec03f02ef28103e19265nd to record information in the access log.</p>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <p>Of course, storing the information in the access log is only
17efa6b5344b7574597eec03f02ef28103e19265nd the start of log management. The next step is to analyze this
17efa6b5344b7574597eec03f02ef28103e19265nd information to produce useful statistics. Log analysis in
17efa6b5344b7574597eec03f02ef28103e19265nd general is beyond the scope of this document, and not really
17efa6b5344b7574597eec03f02ef28103e19265nd part of the job of the web server itself. For more information
17efa6b5344b7574597eec03f02ef28103e19265nd about this topic, and for applications which perform log
17efa6b5344b7574597eec03f02ef28103e19265nd analysis, check the <a href="http://dmoz.org/Computers/Software/Internet/Site_Management/Log_analysis/">
17efa6b5344b7574597eec03f02ef28103e19265nd Open Directory</a> or <a href="http://dir.yahoo.com/Computers_and_Internet/Software/Internet/World_Wide_Web/Servers/Log_Analysis_Tools/">
17efa6b5344b7574597eec03f02ef28103e19265nd Yahoo</a>.</p>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <p>Various versions of Apache httpd have used other modules and
17efa6b5344b7574597eec03f02ef28103e19265nd directives to control access logging, including
17efa6b5344b7574597eec03f02ef28103e19265nd mod_log_referer, mod_log_agent, and the
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai <code>TransferLog</code> directive. The <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> directive now subsumes
8e34905974b7a442a55adac3b3fdb196c389e807takashi the functionality of all the older directives.</p>
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai <p>The format of the access log is highly configurable. The format
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai is specified using a format string that looks much like a C-style
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai printf(1) format string. Some examples are presented in the next
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai sections. For a complete list of the possible contents of the
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai 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>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
8e34905974b7a442a55adac3b3fdb196c389e807takashi <h3><a name="common" id="common">Common Log Format</a></h3>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai <p>A typical configuration for the access log might look as
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai follows.</p>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
8e34905974b7a442a55adac3b3fdb196c389e807takashi <div class="example"><p><code>
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common<br />
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai CustomLog logs/access_log common
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai </code></p></div>
86bb9693d63dfc1be14519a5b444467e4b0cdaf8kawai
17efa6b5344b7574597eec03f02ef28103e19265nd <p>This defines the <em>nickname</em> <code>common</code> and
8e34905974b7a442a55adac3b3fdb196c389e807takashi associates it with a particular log format string. The format
17efa6b5344b7574597eec03f02ef28103e19265nd string consists of percent directives, each of which tell the
17efa6b5344b7574597eec03f02ef28103e19265nd server to log a particular piece of information. Literal
8e34905974b7a442a55adac3b3fdb196c389e807takashi characters may also be placed in the format string and will be
17efa6b5344b7574597eec03f02ef28103e19265nd copied directly into the log output. The quote character
17efa6b5344b7574597eec03f02ef28103e19265nd (<code>"</code>) must be escaped by placing a back-slash before
8e34905974b7a442a55adac3b3fdb196c389e807takashi it to prevent it from being interpreted as the end of the
8e34905974b7a442a55adac3b3fdb196c389e807takashi format string. The format string may also contain the special
8e34905974b7a442a55adac3b3fdb196c389e807takashi control characters "<code>\n</code>" for new-line and
8e34905974b7a442a55adac3b3fdb196c389e807takashi "<code>\t</code>" for tab.</p>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <p>The <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
17efa6b5344b7574597eec03f02ef28103e19265nd directive sets up a new log file using the defined
8e34905974b7a442a55adac3b3fdb196c389e807takashi <em>nickname</em>. The filename for the access log is relative to
8e34905974b7a442a55adac3b3fdb196c389e807takashi the <code class="directive"><a href="/mod/core.html#serverroot">ServerRoot</a></code> unless it
17efa6b5344b7574597eec03f02ef28103e19265nd begins with a slash.</p>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <p>The above configuration will write log entries in a format
17efa6b5344b7574597eec03f02ef28103e19265nd known as the Common Log Format (CLF). This standard format can
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx be produced by many different web servers and read by many log
8e34905974b7a442a55adac3b3fdb196c389e807takashi analysis programs. The log file entries produced in CLF will
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx look something like this:</p>
ef685e00a47967e27d89709461728a229d762172nd
ef685e00a47967e27d89709461728a229d762172nd <div class="example"><p><code>
ef685e00a47967e27d89709461728a229d762172nd 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx /apache_pb.gif HTTP/1.0" 200 2326
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx </code></p></div>
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx <p>Each part of this log entry is described below.</p>
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx <dl>
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx <dt><code>127.0.0.1</code> (<code>%h</code>)</dt>
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx <dd>This is the IP address of the client (remote host) which
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx made the request to the server. If <code class="directive"><a href="/mod/core.html#hostnamelookups">HostnameLookups</a></code> is
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx set to <code>On</code>, then the server will try to determine
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx the hostname and log it in place of the IP address. However,
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx this configuration is not recommended since it can
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx significantly slow the server. Instead, it is best to use a
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick log post-processor such as <a href="programs/logresolve.html">logresolve</a> to determine
8e34905974b7a442a55adac3b3fdb196c389e807takashi the hostnames. The IP address reported here is not
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick necessarily the address of the machine at which the user is
1b3225113bb6fcf326cf16af9023e381ae0ac083nd sitting. If a proxy server exists between the user and the
1b3225113bb6fcf326cf16af9023e381ae0ac083nd server, this address will be the address of the proxy, rather
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick than the originating machine.</dd>
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick
1f666f93c91dbb492dc7706573b369cd03b84265poirier <dt><code>-</code> (<code>%l</code>)</dt>
1f666f93c91dbb492dc7706573b369cd03b84265poirier
1f666f93c91dbb492dc7706573b369cd03b84265poirier <dd>The "hyphen" in the output indicates that the requested
1f666f93c91dbb492dc7706573b369cd03b84265poirier piece of information is not available. In this case, the
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick information that is not available is the RFC 1413 identity of
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick the client determined by <code>identd</code> on the clients
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick machine. This information is highly unreliable and should
1f666f93c91dbb492dc7706573b369cd03b84265poirier almost never be used except on tightly controlled internal
1f666f93c91dbb492dc7706573b369cd03b84265poirier networks. Apache httpd will not even attempt to determine
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick this information unless <code class="directive"><a href="/mod/core.html#identitycheck">IdentityCheck</a></code> is set
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick to <code>On</code>.</dd>
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick <dt><code>frank</code> (<code>%u</code>)</dt>
81622596373177e079337e956f7a5800895443b3erikabele
8e34905974b7a442a55adac3b3fdb196c389e807takashi <dd>This is the userid of the person requesting the document
81622596373177e079337e956f7a5800895443b3erikabele as determined by HTTP authentication. The same value is
ef685e00a47967e27d89709461728a229d762172nd typically provided to CGI scripts in the
ef685e00a47967e27d89709461728a229d762172nd <code>REMOTE_USER</code> environment variable. If the status
ef685e00a47967e27d89709461728a229d762172nd code for the request (see below) is 401, then this value
81622596373177e079337e956f7a5800895443b3erikabele should not be trusted because the user is not yet
81622596373177e079337e956f7a5800895443b3erikabele authenticated. If the document is not password protected,
81622596373177e079337e956f7a5800895443b3erikabele this entry will be "<code>-</code>" just like the previous
81622596373177e079337e956f7a5800895443b3erikabele one.</dd>
81622596373177e079337e956f7a5800895443b3erikabele
81622596373177e079337e956f7a5800895443b3erikabele <dt><code>[10/Oct/2000:13:55:36 -0700]</code>
81622596373177e079337e956f7a5800895443b3erikabele (<code>%t</code>)</dt>
81622596373177e079337e956f7a5800895443b3erikabele
81622596373177e079337e956f7a5800895443b3erikabele <dd>
81622596373177e079337e956f7a5800895443b3erikabele The time that the server finished processing the request.
81622596373177e079337e956f7a5800895443b3erikabele The format is:
81622596373177e079337e956f7a5800895443b3erikabele
81622596373177e079337e956f7a5800895443b3erikabele <p class="indent">
ef685e00a47967e27d89709461728a229d762172nd <code>[day/month/year:hour:minute:second zone]<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen day = 2*digit<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen month = 3*letter<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen year = 4*digit<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen hour = 2*digit<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen minute = 2*digit<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen second = 2*digit<br />
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen zone = (`+' | `-') 4*digit</code>
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen </p>
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen It is possible to have the time displayed in another format
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen by specifying <code>%{format}t</code> in the log format
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen string, where <code>format</code> is as in
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen <code>strftime(3)</code> from the C standard library.
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen </dd>
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen <dt><code>"GET /apache_pb.gif HTTP/1.0"</code>
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen (<code>\"%r\"</code>)</dt>
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen <dd>The request line from the client is given in double
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen quotes. The request line contains a great deal of useful
e554dd2dae4ba2c32dbd05fc0d4e0a42ef4ba902rbowen information. First, the method used by the client is
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele <code>GET</code>. Second, the client requested the resource
8e34905974b7a442a55adac3b3fdb196c389e807takashi <code>/apache_pb.gif</code>, and third, the client used the
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele protocol <code>HTTP/1.0</code>. It is also possible to log
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele one or more parts of the request line independently. For
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele example, the format string "<code>%m %U%q %H</code>" will log
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele the method, path, query-string, and protocol, resulting in
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele exactly the same output as "<code>%r</code>".</dd>
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele <dt><code>200</code> (<code>%&gt;s</code>)</dt>
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele <dd>This is the status code that the server sends back to the
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele client. This information is very valuable, because it reveals
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele whether the request resulted in a successful response (codes
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele beginning in 2), a redirection (codes beginning in 3), an
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele error caused by the client (codes beginning in 4), or an
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele error in the server (codes beginning in 5). The full list of
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele possible status codes can be found in the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.txt">HTTP
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele specification</a> (RFC2616 section 10).</dd>
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki <dt><code>2326</code> (<code>%b</code>)</dt>
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd
8e34905974b7a442a55adac3b3fdb196c389e807takashi <dd>The last entry indicates the size of the object returned
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd to the client, not including the response headers. If no
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd content was returned to the client, this value will be
8e34905974b7a442a55adac3b3fdb196c389e807takashi "<code>-</code>". To log "<code>0</code>" for no content, use
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd <code>%B</code> instead.</dd>
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd </dl>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
8e34905974b7a442a55adac3b3fdb196c389e807takashi
8e34905974b7a442a55adac3b3fdb196c389e807takashi <h3><a name="combined" id="combined">Combined Log Format</a></h3>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd <p>Another commonly used format string is called the Combined
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd Log Format. It can be used as follows.</p>
8e34905974b7a442a55adac3b3fdb196c389e807takashi
8e34905974b7a442a55adac3b3fdb196c389e807takashi <div class="example"><p><code>
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\"
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd \"%{User-agent}i\"" combined<br />
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd CustomLog log/access_log combined
f4166cb2bf5e48c1b0f18b0d1f6757fce82230a8nd </code></p></div>
17efa6b5344b7574597eec03f02ef28103e19265nd
8e34905974b7a442a55adac3b3fdb196c389e807takashi <p>This format is exactly the same as the Common Log Format,
17efa6b5344b7574597eec03f02ef28103e19265nd with the addition of two more fields. Each of the additional
17efa6b5344b7574597eec03f02ef28103e19265nd fields uses the percent-directive
17efa6b5344b7574597eec03f02ef28103e19265nd <code>%{<em>header</em>}i</code>, where <em>header</em> can be
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki any HTTP request header. The access log under this format will
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki look like:</p>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <div class="example"><p><code>
17efa6b5344b7574597eec03f02ef28103e19265nd 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET
17efa6b5344b7574597eec03f02ef28103e19265nd /apache_pb.gif HTTP/1.0" 200 2326
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki "http://www.example.com/start.html" "Mozilla/4.08 [en]
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki (Win98; I ;Nav)"
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki </code></p></div>
17efa6b5344b7574597eec03f02ef28103e19265nd
17efa6b5344b7574597eec03f02ef28103e19265nd <p>The additional fields are:</p>
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki <dl>
17efa6b5344b7574597eec03f02ef28103e19265nd <dt><code>"http://www.example.com/start.html"</code>
e9e8e471353eaa5576e1e96530968d02f208e39fnd (<code>\"%{Referer}i\"</code>)</dt>
e9e8e471353eaa5576e1e96530968d02f208e39fnd
8e34905974b7a442a55adac3b3fdb196c389e807takashi <dd>The "Referer" (sic) HTTP request header. This gives the
e9e8e471353eaa5576e1e96530968d02f208e39fnd site that the client reports having been referred from. (This
e9e8e471353eaa5576e1e96530968d02f208e39fnd should be the page that links to or includes
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun <code>/apache_pb.gif</code>).</dd>
e9e8e471353eaa5576e1e96530968d02f208e39fnd
e9e8e471353eaa5576e1e96530968d02f208e39fnd <dt><code>"Mozilla/4.08 [en] (Win98; I ;Nav)"</code>
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun (<code>\"%{User-agent}i\"</code>)</dt>
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun <dd>The User-Agent HTTP request header. This is the
e9e8e471353eaa5576e1e96530968d02f208e39fnd identifying information that the client browser reports about
e9e8e471353eaa5576e1e96530968d02f208e39fnd itself.</dd>
e9e8e471353eaa5576e1e96530968d02f208e39fnd </dl>
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun
1e1be8a0871405df3c1ec4d6d33aab71996ad0c9nilgun
e9e8e471353eaa5576e1e96530968d02f208e39fnd <h3><a name="multiple" id="multiple">Multiple Access Logs</a></h3>
e9e8e471353eaa5576e1e96530968d02f208e39fnd
e9e8e471353eaa5576e1e96530968d02f208e39fnd
<p>Multiple access logs can be created simply by specifying
multiple <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
directives in the configuration
file. For example, the following directives will create three
access logs. The first contains the basic CLF information,
while the second and third contain referer and browser
information. The last two <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> lines show how
to mimic the effects of the <code>ReferLog</code> and <code>AgentLog</code> directives.</p>
<div class="example"><p><code>
LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common<br />
CustomLog logs/access_log common<br />
CustomLog logs/referer_log "%{Referer}i -&gt; %U"<br />
CustomLog logs/agent_log "%{User-agent}i"
</code></p></div>
<p>This example also shows that it is not necessary to define a
nickname with the <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code> directive. Instead,
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>
<h3><a name="conditional" id="conditional">Conditional Logs</a></h3>
<p>There are times when it is convenient to exclude certain
entries from the access logs based on characteristics of the
client request. This is easily accomplished with the help of <a href="env.html">environment variables</a>. First, an
environment variable must be set to indicate that the request
meets certain conditions. This is usually accomplished with
<code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>. Then the
<code>env=</code> clause of the <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code> directive is used to
include or exclude requests where the environment variable is
set. Some examples:</p>
<div class="example"><p><code>
# Mark requests from the loop-back interface<br />
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog<br />
# Mark requests for the robots.txt file<br />
SetEnvIf Request_URI "^/robots\.txt$" dontlog<br />
# Log what remains<br />
CustomLog logs/access_log common env=!dontlog
</code></p></div>
<p>As another example, consider logging requests from
english-speakers to one log file, and non-english speakers to a
different log file.</p>
<div class="example"><p><code>
SetEnvIf Accept-Language "en" english<br />
CustomLog logs/english_log common env=english<br />
CustomLog logs/non_english_log common env=!english
</code></p></div>
<p>Although we have just shown that conditional logging is very
powerful and flexibly, it is not the only way to control the
contents of the logs. Log files are more useful when they
contain a complete record of server activity. It is often
easier to simply post-process the log files to remove requests
that you do not want to consider.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="rotation" id="rotation">Log Rotation</a></h2>
<p>On even a moderately busy server, the quantity of
information stored in the log files is very large. The access
log file typically grows 1 MB or more per 10,000 requests. It
will consequently be necessary to periodically rotate the log
files by moving or deleting the existing logs. This cannot be
done while the server is running, because Apache will continue
writing to the old log file as long as it holds the file open.
Instead, the server must be <a href="stopping.html">restarted</a> after the log files are
moved or deleted so that it will open new log files.</p>
<p>By using a <em>graceful</em> restart, the server can be
instructed to open new log files without losing any existing or
pending connections from clients. However, in order to
accomplish this, the server must continue to write to the old
log files while it finishes serving old requests. It is
therefore necessary to wait for some time after the restart
before doing any processing on the log files. A typical
scenario that simply rotates the logs and compresses the old
logs to save space is:</p>
<div class="example"><p><code>
mv access_log access_log.old<br />
mv error_log error_log.old<br />
apachectl graceful<br />
sleep 600<br />
gzip access_log.old error_log.old
</code></p></div>
<p>Another way to perform log rotation is using <a href="#piped">piped logs</a> as discussed in the next
section.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="piped" id="piped">Piped Logs</a></h2>
<p>Apache httpd is capable of writing error and access log
files through a pipe to another process, rather than directly
to a file. This capability dramatically increases the
flexibility of logging, without adding code to the main server.
In order to write logs to a pipe, simply replace the filename
with the pipe character "<code>|</code>", followed by the name
of the executable which should accept log entries on its
standard input. Apache will start the piped-log process when
the server starts, and will restart it if it crashes while the
server is running. (This last feature is why we can refer to
this technique as "reliable piped logging".)</p>
<p>Piped log processes are spawned by the parent Apache httpd
process, and inherit the userid of that process. This means
that piped log programs usually run as root. It is therefore
very important to keep the programs simple and secure.</p>
<p>One important use of piped logs is to allow log rotation
without having to restart the server. The Apache HTTP Server
includes a simple program called <a href="programs/rotatelogs.html">rotatelogs</a> for this
purpose. For example, to rotate the logs every 24 hours, you
can use:</p>
<div class="example"><p><code>
CustomLog "|/usr/local/apache/bin/rotatelogs
/var/log/access_log 86400" common
</code></p></div>
<p>Notice that quotes are used to enclose the entire command
that will be called for the pipe. Although these examples are
for the access log, the same technique can be used for the
error log.</p>
<p>A similar but much more flexible log rotation program
called <a href="http://www.cronolog.org/">cronolog</a>
is available at an external site.</p>
<p>As with conditional logging, piped logs are a very powerful
tool, but they should not be used where a simpler solution like
off-line post-processing is available.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="virtualhost" id="virtualhost">Virtual Hosts</a></h2>
<p>When running a server with many <a href="vhosts/">virtual
hosts</a>, there are several options for dealing with log
files. First, it is possible to use logs exactly as in a
single-host server. Simply by placing the logging directives
outside the <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> sections in the
main server context, it is possible to log all requests in the
same access log and error log. This technique does not allow
for easy collection of statistics on individual virtual
hosts.</p>
<p>If <code class="directive"><a href="/mod/mod_log_config.html#customlog">CustomLog</a></code>
or <code class="directive"><a href="/mod/core.html#errorlog">ErrorLog</a></code>
directives are placed inside a
<code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
section, all requests or errors for that virtual host will be
logged only to the specified file. Any virtual host which does
not have logging directives will still have its requests sent
to the main server logs. This technique is very useful for a
small number of virtual hosts, but if the number of hosts is
very large, it can be complicated to manage. In addition, it
can often create problems with <a href="vhosts/fd-limits.html">insufficient file
descriptors</a>.</p>
<p>For the access log, there is a very good compromise. By
adding information on the virtual host to the log format
string, it is possible to log all hosts to the same log, and
later split the log into individual files. For example,
consider the following directives.</p>
<div class="example"><p><code>
LogFormat "%v %l %u %t \"%r\" %&gt;s %b"
comonvhost<br />
CustomLog logs/access_log comonvhost
</code></p></div>
<p>The <code>%v</code> is used to log the name of the virtual
host that is serving the request. Then a program like <a href="programs/other.html">split-logfile</a> can be used to
post-process the access log in order to split it into one file
per virtual host.</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="section">
<h2><a name="other" id="other">Other Log Files</a></h2>
<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><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/mpm_common.html#pidfile">PidFile</a></code></li><li><code class="directive"><a href="/mod/mod_rewrite.html#rewritelog">RewriteLog</a></code></li><li><code class="directive"><a href="/mod/mod_rewrite.html#rewriteloglevel">RewriteLogLevel</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>
<h3><a name="pidfile" id="pidfile">PID File</a></h3>
<p>On startup, Apache httpd saves the process id of the parent
httpd process to the file <code>logs/httpd.pid</code>. This
filename can be changed with the <code class="directive"><a href="/mod/mpm_common.html#pidfile">PidFile</a></code> directive. The
process-id is for use by the administrator in restarting and
terminating the daemon by sending signals to the parent
process; on Windows, use the -k command line option instead.
For more information see the <a href="stopping.html">Stopping
and Restarting</a> page.</p>
<h3><a name="scriptlog" id="scriptlog">Script Log</a></h3>
<p>In order to aid in debugging, the
<code class="directive"><a href="/mod/mod_cgi.html#scriptlog">ScriptLog</a></code> directive
allows you to record the input to and output from CGI scripts.
This should only be used in testing - not for live servers.
More information is available in the <a href="mod/mod_cgi.html">mod_cgi</a> documentation.</p>
<h3><a name="rewritelog" id="rewritelog">Rewrite Log</a></h3>
<p>When using the powerful and complex features of <a href="mod/mod_rewrite.html">mod_rewrite</a>, it is almost
always necessary to use the <code class="directive"><a href="/mod/mod_rewrite.html#rewritelog">RewriteLog</a></code> to help
in debugging. This log file produces a detailed analysis of how
the rewriting engine transforms requests. The level of detail
is controlled by the <code class="directive"><a href="/mod/mod_rewrite.html#rewriteloglevel">RewriteLogLevel</a></code> directive.</p>
</div></div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="/en/logs.html">&nbsp;en&nbsp;</a> | <a href="/ja/logs.html">&nbsp;ja&nbsp;</a> | <a href="/ko/logs.html">&nbsp;ko&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Maintained by the <a href="http://httpd.apache.org/docs-project/">Apache HTTP Server Documentation Project</a></p>
<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>
</body></html>