]> granicus.if.org Git - apache/blobdiff - docs/manual/logs.html.en
XML update.
[apache] / docs / manual / logs.html.en
index 9ae4b7e5926817c0102c42b98121db2576b24622..5c95de5a2e28103e358048781c983e50bd1961df 100644 (file)
@@ -5,16 +5,16 @@
               This file is generated from xml source: DO NOT EDIT
         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
       -->
-<title>Log Files - Apache HTTP Server</title>
+<title>Log Files - Apache HTTP Server Version 2.5</title>
 <link href="./style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
 <link href="./style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
 <link href="./style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="./style/css/prettify.css" />
-<script src="./style/scripts/prettify.js" type="text/javascript">
+<script src="./style/scripts/prettify.min.js" type="text/javascript">
 </script>
 
 <link href="./images/favicon.ico" rel="shortcut icon" /></head>
 <body id="manual-page"><div id="page-header">
-<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
+<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p>
 <p class="apache">Apache HTTP Server Version 2.5</p>
 <img alt="" src="./images/feather.gif" /></div>
 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
@@ -45,7 +45,7 @@
 <li><img alt="" src="./images/down.gif" /> <a href="#piped">Piped Logs</a></li>
 <li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">Virtual Hosts</a></li>
 <li><img alt="" src="./images/down.gif" /> <a href="#other">Other Log Files</a></li>
-</ul></div>
+</ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="overview" id="overview">Overview</a></h2>
     <p>Do this by specifying the name of the module in your
     <code class="directive">LogLevel</code> directive:</p>
 
-    <pre class="prettyprint lang-config">
-    LogLevel info rewrite:trace5
-    </pre>
+    <pre class="prettyprint lang-config">LogLevel info rewrite:trace5</pre>
 
 
     <p>This sets the main <code class="directive">LogLevel</code> to info, but
       <p>A typical configuration for the access log might look as
       follows.</p>
 
-      <pre class="prettyprint lang-config">
-LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
-CustomLog logs/access_log common
-      </pre>
+      <pre class="prettyprint lang-config">LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
+CustomLog logs/access_log common</pre>
 
 
       <p>This defines the <em>nickname</em> <code>common</code> and
@@ -362,10 +358,8 @@ CustomLog logs/access_log common
       <p>Another commonly used format string is called the Combined
       Log Format. It can be used as follows.</p>
 
-      <pre class="prettyprint lang-config">
-LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
-CustomLog log/access_log combined
-      </pre>
+      <pre class="prettyprint lang-config">LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
+CustomLog log/access_log combined</pre>
 
 
       <p>This format is exactly the same as the Common Log Format,
@@ -414,12 +408,10 @@ CustomLog log/access_log combined
       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>
 
-      <pre class="prettyprint lang-config">
-LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
+      <pre class="prettyprint lang-config">LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common
 CustomLog logs/access_log common
 CustomLog logs/referer_log "%{Referer}i -&gt; %U"
-CustomLog logs/agent_log "%{User-agent}i"
-      </pre>
+CustomLog logs/agent_log "%{User-agent}i"</pre>
 
 
       <p>This example also shows that it is not necessary to define a
@@ -440,50 +432,42 @@ CustomLog logs/agent_log "%{User-agent}i"
       include or exclude requests where the environment variable is
       set. Some examples:</p>
 
-      <pre class="prettyprint lang-config">
-# Mark requests from the loop-back interface
+      <pre class="prettyprint lang-config"># Mark requests from the loop-back interface
 SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
 # Mark requests for the robots.txt file
 SetEnvIf Request_URI "^/robots\.txt$" dontlog
 # Log what remains
-CustomLog logs/access_log common env=!dontlog
-      </pre>
+CustomLog logs/access_log common env=!dontlog</pre>
 
 
       <p>As another example, consider logging requests from
       english-speakers to one log file, and non-english speakers to a
       different log file.</p>
 
-      <pre class="prettyprint lang-config">
-        SetEnvIf Accept-Language "en" english<br />
+      <pre class="prettyprint lang-config">        SetEnvIf Accept-Language "en" english<br />
         CustomLog logs/english_log common env=english<br />
-        CustomLog logs/non_english_log common env=!english
-      </pre>
+        CustomLog logs/non_english_log common env=!english</pre>
 
 
       <p>In a caching scenario one would want to know about
       the efficiency of the cache. A very simple method to
       find this out would be:</p>
 
-      <pre class="prettyprint lang-config">
-SetEnv CACHE_MISS 1
+      <pre class="prettyprint lang-config">SetEnv CACHE_MISS 1
 LogFormat "%h %l %u %t "%r " %&gt;s %b %{CACHE_MISS}e" common-cache
-CustomLog logs/access_log common-cache
-      </pre>
+CustomLog logs/access_log common-cache</pre>
 
 
       <p><code class="module"><a href="./mod/mod_cache.html">mod_cache</a></code> will run before
-      <code class="module"><a href="./mod/mod_env.html">mod_env</a></code> and when successfull will deliver the
+      <code class="module"><a href="./mod/mod_env.html">mod_env</a></code> and, when successful, will deliver the
       content without it. In that case a cache hit will log
       <code>-</code>, while a cache miss will log <code>1</code>.</p>
 
       <p>In addition to the <code>env=</code> syntax, <code class="directive"><a href="./mod/mod_log_config.html#logformat">LogFormat</a></code> supports logging values
       conditional upon the HTTP response code:</p>
 
-      <pre class="prettyprint lang-config">
-LogFormat "%400,501{User-agent}i" browserlog
-LogFormat "%!200,304,302{Referer}i" refererlog
-      </pre>
+      <pre class="prettyprint lang-config">LogFormat "%400,501{User-agent}i" browserlog
+LogFormat "%!200,304,302{Referer}i" refererlog</pre>
 
 
       <p>In the first example, the <code>User-agent</code> will be
@@ -563,9 +547,7 @@ LogFormat "%!200,304,302{Referer}i" refererlog
     for this purpose. For example, to rotate the logs every 24 hours, you
     can use:</p>
 
-    <pre class="prettyprint lang-config">
-      CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" common
-    </pre>
+    <pre class="prettyprint lang-config">CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" common</pre>
 
 
     <p>Notice that quotes are used to enclose the entire command
@@ -585,10 +567,8 @@ LogFormat "%!200,304,302{Referer}i" refererlog
     a shell. Use "<code>|$</code>" instead of "<code>|</code>"
     to spawn using a shell (usually with <code>/bin/sh -c</code>):</p>
 
-    <pre class="prettyprint lang-config">
-# Invoke "rotatelogs" using a shell
-CustomLog "|$/usr/local/apache/bin/rotatelogs   /var/log/access_log 86400" common
-    </pre>
+    <pre class="prettyprint lang-config"># Invoke "rotatelogs" using a shell
+CustomLog "|$/usr/local/apache/bin/rotatelogs   /var/log/access_log 86400" common</pre>
 
 
     <p>This was the default behaviour for Apache 2.2.
@@ -632,14 +612,12 @@ CustomLog "|$/usr/local/apache/bin/rotatelogs   /var/log/access_log 86400" commo
     later split the log into individual files. For example,
     consider the following directives.</p>
 
-    <pre class="prettyprint lang-config">
-LogFormat "%v %l %u %t \"%r\" %&gt;s %b" comonvhost
-CustomLog logs/access_log comonvhost
-    </pre>
+    <pre class="prettyprint lang-config">LogFormat "%v %l %u %t \"%r\" %&gt;s %b" comonvhost
+CustomLog logs/access_log comonvhost</pre>
 
 
     <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
+    host that is serving the request. Then a program like <a href="programs/split-logfile.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>
@@ -698,10 +676,27 @@ CustomLog logs/access_log comonvhost
 <a href="./ja/logs.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
 <a href="./ko/logs.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
 <a href="./tr/logs.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
-</div><div id="footer">
-<p class="apache">Copyright 2012 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>
-<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
-if (typeof(prettyPrint) !== undefined) {
+</div><div class="top"><a href="#page-header"><img src="./images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
+<script type="text/javascript"><!--//--><![CDATA[//><!--
+var comments_shortname = 'httpd';
+var comments_identifier = 'http://httpd.apache.org/docs/trunk/logs.html';
+(function(w, d) {
+    if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
+        d.write('<div id="comments_thread"><\/div>');
+        var s = d.createElement('script');
+        s.type = 'text/javascript';
+        s.async = true;
+        s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
+        (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
+    }
+    else {
+        d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
+    }
+})(window, document);
+//--><!]]></script></div><div id="footer">
+<p class="apache">Copyright 2014 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>
+<p class="menu"><a href="./mod/">Modules</a> | <a href="./mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="./glossary.html">Glossary</a> | <a href="./sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
+if (typeof(prettyPrint) !== 'undefined') {
     prettyPrint();
 }
 //--><!]]></script>