incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling Website > Client Request Logging
Date Fri, 05 Aug 2011 12:06:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Client+Request+Logging">Client
Request Logging</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~fmeschbe">Felix
Meschberger</a>
    </h4>
        <br/>
                         <h4>Changes (14)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >In the Web Console configure the _Apache
Sling Request Logger_ (PID={{org.apache.sling.engine.impl.log.RequestLogger}}) configuration.
<br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TBD
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">In
the Sling Web Console locate the Configuration page ({{/system/console/configMgr}}) and click
on the {{+}} (plus) symbol on the _Apache Sling Customizable Request Data Logger_ line. This
opens a dialog to enter the configuration whose properties can be configured as follows: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">||
Parameter || Name || Default || Description || <br>| Request Log Name | {{request.log.output}}
| Name of the destination for the request log. The request log logs the entry and exit of
each request into and out of the system together with the entry time, exit time, time to process
the request, a request counter as well as the final status code and response content type.
In terms of Request Logger Service formats, request entry is logged with the format {{%t [%R]
-&gt; %m %U%q %H}} and request exit is logged with the format {{%{end}t [%R] &lt;-
%s %{Content-Type}o %Dms}} (See [#Log Format Specification] below for the specification of
the format). | <br>| Request Log Type | {{request.log.outputtype}} | Type of Logger
named with the Logger Name parameter. See [#Log Output] below | <br>| Enable Request
Log | {{request.log.enabled}} | Whether to enable Request logging or not. | <br>| Access
Log Name | {{access.log.output}} | Name of the destination for the access log. The access
log writes an entry for each request as the request terminates using the NCSA extended/combined
log format. In terms of Request Logger Service formats the access log is written with the
format {{%h %l %u %t &quot;%r&quot; %&gt;s %b &quot;%{Referer}i&quot;
&quot;%{User-Agent}i&quot;}} (See [#Log Format Specification] below for the specification
of the format). | <br>| Access Log Type | {{access.log.outputtype}} Type of Logger named
with the Logger Name parameter. See [#Log Output] below | <br>| Enable Access Log |
{{access.log.enabled}} | Whether to enable Access logging or not. | <br> <br>
<br>h4. Log Output <br> <br>Output of client request logging is defined
by the Logger Type and and Logger Name where the use of the Logger Name property value depends
on the Logger Type: <br> <br>|| Type Code || Type Name || Description and Logger
Name interpretation || <br>| 0 | Logger Name | Writes the logging information to a named
SLF4J Logger. The name of the Logger is defined in the Logger Name property. The actual destination
of the log messages is defined the SLF4J configuration for the named logger | <br>|
1 | File Name | Writes the logging information to a file, on message per line. The file name
is an absolute or relative path name. If the name is relative, it is resolved against the
{{sling.home}} framework property. | <br>| 2 | RequestLog Service | Sends the logging
information to a {{org.apache.sling.engine.RequestLog}} service whose {{requestlog.name}}
service registration property must the same as the value of the Logger Name property. If more
than one such service is registered, all services are called. If no such service is registered,
the logging information is discarded. Using RequestLog Services is deprecated. | <br>
<br>*Note:* If logging to a file, this file is not rotated and/or limited by size. To
get log file rotation use the _Logger Name_ logging type. See [#Rotating Logger Files] below
for information on how logging information can be written to rotated and/or size limited files.
<br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Additional per-request Loggers
<br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >|| Parameter || Name || Default ||
Description || <br>| Log Format | {{request.log.service.format}} | Specify a [#Log Format
Specification] as described below | <br></td></tr>
            <tr><td class="diff-changed-lines" >| Logger Type | {{request.log.service.outputtype}}
| <span class="diff-added-words"style="background-color: #dfd;">Logger Name/{{0}} |</span>
Type of Logger named with the Logger Name parameter. See [#Log Output] <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">below</span>
<span class="diff-added-words"style="background-color: #dfd;">above</span> | <br></td></tr>
            <tr><td class="diff-changed-lines" >| Logger Name | {{request.log.service.output}}
| <span class="diff-added-words"style="background-color: #dfd;">{{request.log}} |</span>
Name of the Logger to be used. See [#Log Output] <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">below</span>
<span class="diff-added-words"style="background-color: #dfd;">above</span> | <br></td></tr>
            <tr><td class="diff-unchanged" >| Request Entry | {{request.log.service.onentry}}
| unchecked/{{false}} | Whether logger is called at the start of request processing or after
processing the request | <br> <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h4.
Log Output <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">TBD
<br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Log Format Specification <br>
<br></td></tr>
            <tr><td class="diff-changed-lines" >The log format specification follows
the [definition of the {{format}} argument for the {{LogFormat}} and {{CustomLog}} directives
of Apache <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">HTTPD|http://httpd.apache.org/docs/current/mod/mod_log_config.html]:</span>
<span class="diff-added-words"style="background-color: #dfd;">httpd|http://httpd.apache.org/docs/current/mod/mod_log_config.html]:</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
format can contain literal characters copied into the log files and the C-style control characters
&quot;\n&quot; and &quot;\t&quot; to represent new-lines and tabs. Literal
quotes and backslashes should be escaped with backslashes. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The
characteristics of the request itself are logged by placing &quot;%&quot; directives
in the format string, which are replaced in the log file by the values as follows: <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
characteristics of the request itself are logged by placing &quot;%&quot; directives
in the format string, which are replaced in the log file by the values as follows (additions
to the Apache HTTPD specification are set in italic while non-applicable statements are striked
through) : <br> <br></td></tr>
            <tr><td class="diff-unchanged" >|| Format String || Description ||
<br>| {{%%}}  | The percent sign | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| {{%s}}  | Status. | <br>|
{{%t}}  | Time the request was received (standard english format) | <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">|
{{%\{format}t}}  | Same as {{%t}}; the {{format}} parameter is ignored. | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">|
{{%\{format}t}}  | Same as {{%t}}; the {{format}} parameter is ignored unless it is the literal
value _end_ indicating to use the time of request terminating (instead of the time of request
receipt). | <br></td></tr>
            <tr><td class="diff-unchanged" >| {{%T}}  | The time taken to serve
the request, in seconds. | <br>| {{%u}}  | Remote user (from auth; may be bogus if return
status (%s) is 401) | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| {{%O}}  | Not supported in Sling;
prints nothing. | <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>*Modifiers* <br> <br>Particular items can be restricted to print only
for responses with specific HTTP status codes by placing a comma-separated list of status
codes immediately following the &quot;%&quot;. For example, &quot;%400,501{User-agent}i&quot;
logs User-agent on 400 errors and 501 errors only. For other status codes, the literal string
&quot;-&quot; will be logged. The status code list may be preceded by a &quot;!&quot;
to indicate negation: &quot;%!200,304,302{Referer}i&quot; logs Referer on all requests
that do not return one of the three specified codes. <br> <br>The Apache httpd
modifiers &quot;&lt;&quot; and &quot;&gt;&quot;  are not supported
by Sling and currently ignored. <br> <br> <br>*Some Notes* <br> <br>For
security reasons non-printable and other special characters in %C, %i and %o are escaped using
\uhhhh sequences, where hhhh stands for the hexadecimal representation of the character&#39;s
unicode value. Exceptions from this rule are &quot; and \, which are escaped by prepending
a backslash, and all whitespace characters, which are written in their Java-style notation
(\n, \t, etc). <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h4. Rotating Logger Files <br>
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="ClientRequestLogging-ClientRequestLogging"></a>Client
Request Logging</h1>

<p>Sling provides extensive support to log various information at the before and after
processing client requests. Out of the box, there are two loggers configured to write traditional
<tt>access.log</tt> and <tt>request.log</tt> files. In addition more
logging can be configured by providing OSGi Configuration Admin configuration.</p>

<h2><a name="ClientRequestLogging-Traditionalaccess.logandrequest.logFiles"></a>Traditional
access.log and request.log Files</h2>

<p>In the Web Console configure the <em>Apache Sling Request Logger</em>
(PID=<tt>org.apache.sling.engine.impl.log.RequestLogger</tt>) configuration.</p>

<p>In the Sling Web Console locate the Configuration page (<tt>/system/console/configMgr</tt>)
and click on the <tt>+</tt> (plus) symbol on the <em>Apache Sling Customizable
Request Data Logger</em> line. This opens a dialog to enter the configuration whose
properties can be configured as follows:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Parameter </th>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> Request Log Name </td>
<td class='confluenceTd'> <tt>request.log.output</tt> </td>
<td class='confluenceTd'> Name of the destination for the request log. The request log
logs the entry and exit of each request into and out of the system together with the entry
time, exit time, time to process the request, a request counter as well as the final status
code and response content type. In terms of Request Logger Service formats, request entry
is logged with the format <tt>%t <a href="/confluence/pages/createpage.action?spaceKey=SLINGxSITE&amp;title=%25R&amp;linkCreation=true&amp;fromPageId=27823478"
class="createlink">&#37;R</a> -&gt; %m %U%q %H</tt> and request exit
is logged with the format {{%
<div class="error"><span class="error">Unknown macro: {end}</span> </div>
<p>t <a href="/confluence/pages/createpage.action?spaceKey=SLINGxSITE&amp;title=%25R&amp;linkCreation=true&amp;fromPageId=27823478"
class="createlink">&#37;R</a> &lt;- %s %</p>
<div class="error"><span class="error">Unknown macro: {Content-Type}</span>
</div>
<p>o %Dms}} (See <a href="#ClientRequestLogging-LogFormatSpecification">Log Format
Specification</a> below for the specification of the format). </p></td>
</tr>
<tr>
<td class='confluenceTd'> Request Log Type </td>
<td class='confluenceTd'> <tt>request.log.outputtype</tt> </td>
<td class='confluenceTd'> Type of Logger named with the Logger Name parameter. See <a
href="#ClientRequestLogging-LogOutput">Log Output</a> below </td>
</tr>
<tr>
<td class='confluenceTd'> Enable Request Log </td>
<td class='confluenceTd'> <tt>request.log.enabled</tt> </td>
<td class='confluenceTd'> Whether to enable Request logging or not. </td>
</tr>
<tr>
<td class='confluenceTd'> Access Log Name </td>
<td class='confluenceTd'> <tt>access.log.output</tt> </td>
<td class='confluenceTd'> Name of the destination for the access log. The access log
writes an entry for each request as the request terminates using the NCSA extended/combined
log format. In terms of Request Logger Service formats the access log is written with the
format {{%h %l %u %t "%r" %&gt;s %b "%
<div class="error"><span class="error">Unknown macro: {Referer}</span> <p>i"
"%</p>
<div class="error"><span class="error">Unknown macro: {User-Agent}</span>
</div>
<p>i"}} (See <a href="#ClientRequestLogging-LogFormatSpecification">Log Format
Specification</a> below for the specification of the format). |</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Access Log Type </td>
<td class='confluenceTd'> <tt>access.log.outputtype</tt> Type of Logger
named with the Logger Name parameter. See <a href="#ClientRequestLogging-LogOutput">Log
Output</a> below </td>
</tr>
<tr>
<td class='confluenceTd'> Enable Access Log </td>
<td class='confluenceTd'> <tt>access.log.enabled</tt> </td>
<td class='confluenceTd'> Whether to enable Access logging or not. </td>
</tr>
</tbody></table>
</div>



<h4><a name="ClientRequestLogging-LogOutput"></a>Log Output</h4>

<p>Output of client request logging is defined by the Logger Type and and Logger Name
where the use of the Logger Name property value depends on the Logger Type:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Type Code </th>
<th class='confluenceTh'> Type Name </th>
<th class='confluenceTh'> Description and Logger Name interpretation </th>
</tr>
<tr>
<td class='confluenceTd'> 0 </td>
<td class='confluenceTd'> Logger Name </td>
<td class='confluenceTd'> Writes the logging information to a named SLF4J Logger. The
name of the Logger is defined in the Logger Name property. The actual destination of the log
messages is defined the SLF4J configuration for the named logger </td>
</tr>
<tr>
<td class='confluenceTd'> 1 </td>
<td class='confluenceTd'> File Name </td>
<td class='confluenceTd'> Writes the logging information to a file, on message per line.
The file name is an absolute or relative path name. If the name is relative, it is resolved
against the <tt>sling.home</tt> framework property. </td>
</tr>
<tr>
<td class='confluenceTd'> 2 </td>
<td class='confluenceTd'> RequestLog Service </td>
<td class='confluenceTd'> Sends the logging information to a <tt>org.apache.sling.engine.RequestLog</tt>
service whose <tt>requestlog.name</tt> service registration property must the
same as the value of the Logger Name property. If more than one such service is registered,
all services are called. If no such service is registered, the logging information is discarded.
Using RequestLog Services is deprecated. </td>
</tr>
</tbody></table>
</div>


<p><b>Note:</b> If logging to a file, this file is not rotated and/or limited
by size. To get log file rotation use the <em>Logger Name</em> logging type. See
<a href="#ClientRequestLogging-RotatingLoggerFiles">Rotating Logger Files</a>
below for information on how logging information can be written to rotated and/or size limited
files.</p>


<h3><a name="ClientRequestLogging-AdditionalperrequestLoggers"></a>Additional
per-request Loggers</h3>

<p>In the Web Console create <em>Apache Sling Customizable Request Data Logger</em>
(Factory PID=<tt>org.apache.sling.engine.impl.log.RequestLoggerService</tt>) configuration.</p>

<p>In the Sling Web Console locate the Configuration page (<tt>/system/console/configMgr</tt>)
and click on the <tt>+</tt> (plus) symbol on the <em>Apache Sling Customizable
Request Data Logger</em> line. This opens a dialog to enter the configuration whose
properties can be configured as follows:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Parameter </th>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> Log Format </td>
<td class='confluenceTd'> <tt>request.log.service.format</tt> </td>
<td class='confluenceTd'> Specify a <a href="#ClientRequestLogging-LogFormatSpecification">Log
Format Specification</a> as described below </td>
</tr>
<tr>
<td class='confluenceTd'> Logger Type </td>
<td class='confluenceTd'> <tt>request.log.service.outputtype</tt> </td>
<td class='confluenceTd'> Logger Name/<tt>0</tt> </td>
<td class='confluenceTd'> Type of Logger named with the Logger Name parameter. See <a
href="#ClientRequestLogging-LogOutput">Log Output</a> above </td>
</tr>
<tr>
<td class='confluenceTd'> Logger Name </td>
<td class='confluenceTd'> <tt>request.log.service.output</tt> </td>
<td class='confluenceTd'> <tt>request.log</tt> </td>
<td class='confluenceTd'> Name of the Logger to be used. See <a href="#ClientRequestLogging-LogOutput">Log
Output</a> above </td>
</tr>
<tr>
<td class='confluenceTd'> Request Entry </td>
<td class='confluenceTd'> <tt>request.log.service.onentry</tt> </td>
<td class='confluenceTd'> unchecked/<tt>false</tt> </td>
<td class='confluenceTd'> Whether logger is called at the start of request processing
or after processing the request </td>
</tr>
</tbody></table>
</div>




<h4><a name="ClientRequestLogging-LogFormatSpecification"></a>Log Format
Specification</h4>

<p>The log format specification follows the <a href="http://httpd.apache.org/docs/current/mod/mod_log_config.html"
class="external-link" rel="nofollow">definition of the <tt>format</tt> argument
for the <tt>LogFormat</tt> and <tt>CustomLog</tt> directives of Apache
httpd</a>:</p>

<p>The characteristics of the request itself are logged by placing "%" directives in
the format string, which are replaced in the log file by the values as follows:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Format String </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>%%</tt>  </td>
<td class='confluenceTd'> The percent sign </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%a</tt>  </td>
<td class='confluenceTd'> Remote IP-address </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%A</tt>  </td>
<td class='confluenceTd'> Local IP-address </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%B</tt>  </td>
<td class='confluenceTd'> Size of response in bytes, excluding HTTP headers. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%b</tt>  </td>
<td class='confluenceTd'> Size of response in bytes, excluding HTTP headers. In CLF
format, i.e. a '-' rather than a 0 when no bytes are sent. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{Foobar}C</tt>  </td>
<td class='confluenceTd'> The contents of cookie Foobar in the request sent to the server.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%D</tt>  </td>
<td class='confluenceTd'> The time taken to serve the request, in microseconds. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{FOOBAR}e</tt>  </td>
<td class='confluenceTd'>Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%f</tt>  </td>
<td class='confluenceTd'> The absolute path of the resolved resource </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%h</tt>  </td>
<td class='confluenceTd'> Remote host </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%H</tt>  </td>
<td class='confluenceTd'> The request protocol </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{Foobar}i</tt>  </td>
<td class='confluenceTd'> The contents of Foobar: header line(s) in the request sent
to the server. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%k</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%l</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%m</tt>  </td>
<td class='confluenceTd'> The request method </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{Foobar}n</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{Foobar}o</tt>  </td>
<td class='confluenceTd'> The contents of Foobar: header line(s) in the reply. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%p</tt>  </td>
<td class='confluenceTd'> The canonical port of the server serving the request </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{format}p</tt>  </td>
<td class='confluenceTd'> The canonical port of the server serving the request or the
server's actual port or the client's actual port. Valid formats are canonical, local, or remote.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%P</tt>  </td>
<td class='confluenceTd'> The <em>name of the thread</em> <del>process
ID of the child</del> that serviced the request. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{format}P</tt>  </td>
<td class='confluenceTd'> Same as <tt>%P</tt>; the <tt>format</tt>
parameter is ignored. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%q</tt>  </td>
<td class='confluenceTd'> The query string (prepended with a ? if a query string exists,
otherwise an empty string) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%r</tt>  </td>
<td class='confluenceTd'> First line of request </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%R</tt>  </td>
<td class='confluenceTd'> The number of requests processed by Sling since the last start.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%s</tt>  </td>
<td class='confluenceTd'> Status. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%t</tt>  </td>
<td class='confluenceTd'> Time the request was received (standard english format) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%{format}t</tt>  </td>
<td class='confluenceTd'> Same as <tt>%t</tt>; the <tt>format</tt>
parameter is ignored unless it is the literal value <em>end</em> indicating to
use the time of request terminating (instead of the time of request receipt). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%T</tt>  </td>
<td class='confluenceTd'> The time taken to serve the request, in seconds. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%u</tt>  </td>
<td class='confluenceTd'> Remote user (from auth; may be bogus if return status (%s)
is 401) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%U</tt>  </td>
<td class='confluenceTd'> The URL path requested, not including any query string. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%v</tt>  </td>
<td class='confluenceTd'> The canonical ServerName of the server serving the request.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%V</tt>  </td>
<td class='confluenceTd'> Same as <tt>%v</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%X</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%I</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>%O</tt>  </td>
<td class='confluenceTd'> Not supported in Sling; prints nothing. </td>
</tr>
</tbody></table>
</div>



<p><b>Modifiers</b></p>

<p>Particular items can be restricted to print only for responses with specific HTTP
status codes by placing a comma-separated list of status codes immediately following the "%".
For example, "%400,501</p>
<div class="error"><span class="error">Unknown macro: {User-agent}</span>
</div>
<p>i" logs User-agent on 400 errors and 501 errors only. For other status codes, the
literal string "-" will be logged. The status code list may be preceded by a "!" to indicate
negation: "%!200,304,302</p></div>
<p>i" logs Referer on all requests that do not return one of the three specified codes.</p></td>
</tr>
</tbody></table>
</div>


<p>The Apache httpd modifiers "&lt;" and "&gt;"  are not supported by Sling
and currently ignored.</p>


<p><b>Some Notes</b></p>

<p>For security reasons non-printable and other special characters in %C, %i and %o
are escaped using \uhhhh sequences, where hhhh stands for the hexadecimal representation of
the character's unicode value. Exceptions from this rule are " and \, which are escaped by
prepending a backslash, and all whitespace characters, which are written in their Java-style
notation (\n, \t, etc).</p>


<h4><a name="ClientRequestLogging-RotatingLoggerFiles"></a>Rotating Logger
Files</h4>

<p>TBD</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Client+Request+Logging">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27823478&revisedVersion=3&originalVersion=2">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SLINGxSITE/Client+Request+Logging?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message