[LOGBack-dev] svn commit: r594 - logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Sep 19 16:02:05 CEST 2006


Author: seb
Date: Tue Sep 19 16:02:04 2006
New Revision: 594

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java

Log:
- added a configuration example in the javadoc

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/SizeBasedTriggeringPolicy.java	Tue Sep 19 16:02:04 2006
@@ -14,7 +14,38 @@
 
 /**
  * SizeBasedTriggeringPolicy looks at size of the file being
- * currently written to.
+ * currently written to. If it grows bigger than the specified size, 
+ * the FileAppender using the SizeBasedTriggeringPolicy rolls the file
+ * and creates a new one.
+ * <p>
+ * Here is an example of a configuration using SizeBasedTriggeringPolicy.
+ * <p>
+ * <pre>
+ * &lt;configuration&gt;
+ *    &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
+ *    &lt;rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"&gt;
+ *      &lt;param name="ActiveFile" value="outputFile.log" /&gt;
+ *      &lt;param name="FileNamePattern" value="logFile.%i.log" /&gt;
+ *      &lt;param name="MinIndex" value="1" /&gt;
+ *      &lt;param name="MaxIndex" value="3" /&gt;
+ *    &lt;/rollingPolicy&gt;
+ *
+ *    <b>&lt;triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedRollingPolicy"&gt;
+ *      &lt;param name="MaxFileSize" value="5MB" /&gt;
+ *    &lt;/triggeringPolicy&gt;</b>
+ *
+ *    &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
+ *      &lt;param name="pattern" value="%-4relative [%thread] %-5level %class - %msg%n" /&gt;
+ *    &lt;/layout&gt;
+ *  &lt;/appender&gt; 
+ * 
+ *  &lt;root&gt;
+ *    &lt;level value="debug" /&gt;
+ *    &lt;appender-ref ref="FILE" /&gt;
+ *  &lt;/root&gt;
+ * &lt;/configuration&gt;
+ * </pre>
+ * 
  * 
  * @author Ceki G&uuml;lc&uuml;
  *



More information about the logback-dev mailing list