[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>
+ * <configuration>
+ * <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ * <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+ * <param name="ActiveFile" value="outputFile.log" />
+ * <param name="FileNamePattern" value="logFile.%i.log" />
+ * <param name="MinIndex" value="1" />
+ * <param name="MaxIndex" value="3" />
+ * </rollingPolicy>
+ *
+ * <b><triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedRollingPolicy">
+ * <param name="MaxFileSize" value="5MB" />
+ * </triggeringPolicy></b>
+ *
+ * <layout class="ch.qos.logback.classic.PatternLayout">
+ * <param name="pattern" value="%-4relative [%thread] %-5level %class - %msg%n" />
+ * </layout>
+ * </appender>
+ *
+ * <root>
+ * <level value="debug" />
+ * <appender-ref ref="FILE" />
+ * </root>
+ * </configuration>
+ * </pre>
+ *
*
* @author Ceki Gülcü
*
More information about the logback-dev
mailing list