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 10:21: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 (2)</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 create _Apache
Sling Customizable Request Data Logger_ (Factory PID={{org.apache.sling.engine.impl.log.RequestLoggerService}})
configuration. <br> <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>
<br>|| Parameter || Name || Default || Description || <br>| Log Format | {{request.log.service.format}}
| Specify a [#Log Format Specification] as described below | <br>| Logger Type | {{request.log.service.outputtype}}
| Type of Logger named with the Logger Name parameter. See [#Log Output] below | <br>|
Logger Name | {{request.log.service.output}} | Name of the Logger to be used. See [#Log Output]
below | <br>| 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>h4. Log Output <br> <br></td></tr>
            <tr><td class="diff-unchanged" >TBD <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>h4. Log Format Specification <br> <br>The log format specification follows
the [definition of the {{format}} argument for the {{LogFormat}} and {{CustomLog}} directives
of Apache HTTPD|http://httpd.apache.org/docs/current/mod/mod_log_config.html]: <br>
<br>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> <br>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>|| Format String || Description || <br>| {{%%}}  | The
percent sign | <br>| {{%a}}  | Remote IP-address | <br>| {{%A}}  | Local IP-address
| <br>| {{%B}}  | Size of response in bytes, excluding HTTP headers. | <br>| {{%b}}
 | Size of response in bytes, excluding HTTP headers. In CLF format, i.e. a &#39;-&#39;
rather than a 0 when no bytes are sent. | <br>| {{%\{Foobar}C}}  | The contents of cookie
Foobar in the request sent to the server. | <br>| {{%D}}  | The time taken to serve
the request, in microseconds. | <br>| {{%\{FOOBAR}e}}  |Not supported in Sling; prints
nothing. | <br>| {{%f}}  | The absolute path of the resolved resource | <br>|
{{%h}}  | Remote host | <br>| {{%H}}  | The request protocol | <br>| {{%\{Foobar}i}}
 | The contents of Foobar: header line(s) in the request sent to the server. | <br>|
{{%k}}  | Not supported in Sling; prints nothing. | <br>| {{%l}}  | Not supported in
Sling; prints nothing. | <br>| {{%m}}  | The request method | <br>| {{%\{Foobar}n}}
 | Not supported in Sling; prints nothing. | <br>| {{%\{Foobar}o}}  | The contents of
Foobar: header line(s) in the reply. | <br>| {{%p}}  | The canonical port of the server
serving the request | <br>| {{%\{format}p}}  | The canonical port of the server serving
the request or the server&#39;s actual port or the client&#39;s actual port. Valid
formats are canonical, local, or remote. | <br>| {{%P}}  | The _name of the thread_
-process ID of the child- that serviced the request. | <br>| {{%\{format}P}}  | Same
as {{%P}}; the {{format}} parameter is ignored. | <br>| {{%q}}  | The query string (prepended
with a ? if a query string exists, otherwise an empty string) | <br>| {{%r}}  | First
line of request | <br>| {{%R}}  | The number of requests processed by Sling since the
last start. | <br>| {{%s}}  | Status. | <br>| {{%t}}  | Time the request was received
(standard english format) | <br>| {{%\{format}t}}  | Same as {{%t}}; the {{format}}
parameter is ignored. | <br>| {{%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>| {{%U}}  | The URL path requested, not including any query string. | <br>|
{{%v}}  | The canonical ServerName of the server serving the request. | <br>| {{%V}}
 | Same as {{%v}}. | <br>| {{%X}}  | Not supported in Sling; prints nothing. | <br>|
{{%I}}  | Not supported in Sling; prints nothing. | <br>| {{%O}}  | Not supported in
Sling; prints nothing. | <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>TBD</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'> Type of Logger named with the Logger Name parameter. See <a
href="#ClientRequestLogging-LogOutput">Log Output</a> below </td>
</tr>
<tr>
<td class='confluenceTd'> Logger Name </td>
<td class='confluenceTd'> <tt>request.log.service.output</tt> </td>
<td class='confluenceTd'> Name of the Logger to be used. See <a href="#ClientRequestLogging-LogOutput">Log
Output</a> below </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-LogOutput"></a>Log Output</h4>

<p>TBD</p>


<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 format can contain literal characters copied into the log files and the C-style
control characters "\n" and "\t" to represent new-lines and tabs. Literal quotes and backslashes
should be escaped with backslashes.</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 (additions
to the Apache HTTPD specification are set in italic while non-applicable statements are striked
through) :</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. </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>


<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=2&originalVersion=1">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