[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">&lt;layout class="ch.qos.logback.access.PatternLayout"&gt;
   &lt;Pattern>%h %l %u %t "%r" %s %b "%i{Referer}" "%i{User-Agent}"&lt;/Pattern&gt;
-  &lt;/layout&gt;</div>
+&lt;/layout&gt;</div>
 
   <p>is equivalent to:</p>
 
   <div class="source">&lt;layout class="ch.qos.logback.access.PatternLayout"&gt;
-  &lt;Pattern>combined&lt;/Pattern&gt;&lt;/layout&gt;
+  &lt;Pattern>combined&lt;/Pattern&gt;
+&lt;/layout&gt;
   </div>
 
 
@@ -198,32 +199,31 @@
 		<code>SMTPAppender</code>, could be:</p>
 		<pre>
 &lt;configuration&gt;
-  &lt;appender name="SMTP"
-    class="ch.qos.logback.access.net.SMTPAppender"&gt;
-    &lt;layout
-      class="ch.qos.logback.access.PatternLayout"&gt;
-      &lt;param name="pattern"
-        value="%remoteIP [%date] %requestURL %statusCode %bytesSent" /&gt;
-    &lt;/layout&gt;
-    &lt;param name="From" value="sender at domaine.org" /&gt;
-    &lt;param name="SMTPHost" value="mail.domain.org" /&gt;
-    &lt;param name="Subject"
-      value="Last Event: %statusCode %requestURL" /&gt;
-    &lt;param name="To" value="server_admin at domain.org" /&gt;
-    &lt;/appender&gt;
-  &lt;appender-ref ref="SMTP" /&gt;
+  &lt;appender name="FILE"
+		class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
+		&lt;rollingPolicy
+			class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
+     &lt;param name="ActiveFileName" value="access.log" /&gt;
+     &lt;param name="FileNamePattern" value="access.%d{yyyy-MM-dd}.log.zip" /&gt;
+		&lt;/rollingPolicy&gt;
+
+		&lt;layout class="ch.qos.logback.access.PatternLayout"&gt;
+			&lt;param name="Pattern"
+				value="combined" /&gt;
+		&lt;/layout&gt;
+	&lt;/appender&gt;
+ 
+  &lt;appender-ref ref="FILE" /&gt;
 &lt;/configuration&gt;
 		</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