[logback-dev] svn commit: r662 - in logback/trunk: logback-access/src/main/java/ch/qos/logback/access logback-site/src/site/xdocTemplates
noreply.seb at qos.ch
noreply.seb at qos.ch
Wed Oct 11 12:03:13 CEST 2006
Author: seb
Date: Wed Oct 11 12:03:12 2006
New Revision: 662
Modified:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
logback/trunk/logback-site/src/site/xdocTemplates/accessLogJetty.xml
Log:
- corrected combined pattern
- updated jetty doc with tested configuration of RollingFileAppender
-
Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java (original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java Wed Oct 11 12:03:12 2006
@@ -225,7 +225,7 @@
public static String CLF_PATTERN = "%h %l %u %t \"%r\" %s %b";
public static String CLF_PATTERN_NAME = "common";
public static String CLF_PATTERN_NAME_2 = "clf";
- public static String COMBINED_PATTERN = "%h %l %u %t \"%r\" %>s %b \"%i{Referer}\" \"%i{User-Agent}";
+ public static String COMBINED_PATTERN = "%h %l %u %t \"%r\" %s %b \"%i{Referer}\" \"%i{User-Agent}";
public static String COMBINED_PATTERN_NAME = "combined";
static {
Modified: logback/trunk/logback-site/src/site/xdocTemplates/accessLogJetty.xml
==============================================================================
--- logback/trunk/logback-site/src/site/xdocTemplates/accessLogJetty.xml (original)
+++ logback/trunk/logback-site/src/site/xdocTemplates/accessLogJetty.xml Wed Oct 11 12:03:12 2006
@@ -183,12 +183,13 @@
<div class="source"><layout class="ch.qos.logback.access.PatternLayout">
<Pattern>%h %l %u %t "%r" %s %b "%i{Referer}" "%i{User-Agent}"</Pattern>
- </layout></div>
+</layout></div>
<p>is equivalent to:</p>
<div class="source"><layout class="ch.qos.logback.access.PatternLayout">
- <Pattern>combined</Pattern></layout>
+ <Pattern>combined</Pattern>
+</layout>
</div>
@@ -198,32 +199,31 @@
<code>SMTPAppender</code>, could be:</p>
<pre>
<configuration>
- <appender name="SMTP"
- class="ch.qos.logback.access.net.SMTPAppender">
- <layout
- class="ch.qos.logback.access.PatternLayout">
- <param name="pattern"
- value="%remoteIP [%date] %requestURL %statusCode %bytesSent" />
- </layout>
- <param name="From" value="sender at domaine.org" />
- <param name="SMTPHost" value="mail.domain.org" />
- <param name="Subject"
- value="Last Event: %statusCode %requestURL" />
- <param name="To" value="server_admin at domain.org" />
- </appender>
- <appender-ref ref="SMTP" />
+ <appender name="FILE"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <param name="ActiveFileName" value="access.log" />
+ <param name="FileNamePattern" value="access.%d{yyyy-MM-dd}.log.zip" />
+ </rollingPolicy>
+
+ <layout class="ch.qos.logback.access.PatternLayout">
+ <param name="Pattern"
+ value="combined" />
+ </layout>
+ </appender>
+
+ <appender-ref ref="FILE" />
</configuration>
</pre>
-
<p>
Here, there is no output to the console. Instead, logback access
- builds a buffer with the logging events, and in case of an
- events that meets a certain condition, an email is sent to the
- specified address, using the declared informations. By default,
- an event that would cause an email to be sent is when a status
- code of 500 or more occurs, which means that an error occured on
- the server.
+ logs to the file named access.log. This file will be rolled over
+ every 24 hours. We specify in the configuration the name of the file
+ where the actual logging is added, and the pattern that the archived
+ files must match.
+ The newly archived file will be automatically compressed.
</p>
<p>
More information about the logback-dev
mailing list