[logback-dev] svn commit: r2428 - logback/trunk/logback-examples/src/main/java/chapter4/conf

noreply.ceki at qos.ch noreply.ceki at qos.ch
Sun Aug 9 19:54:56 CEST 2009


Author: ceki
Date: Sun Aug  9 19:54:56 2009
New Revision: 2428

Added:
   logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-timestamp.xml
Modified:
   logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml

Log:
- added a new config file

Modified: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml	(original)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-fileAppender.xml	Sun Aug  9 19:54:56 2009
@@ -4,7 +4,7 @@
 		<File>testFile.log</File>
 		<Append>true</Append>
 		
-		<layout class="ch.qos.logback.classic.PatternLayout">
+		<layout>
 			<Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
 		</layout>
 	</appender>

Added: logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-timestamp.xml
==============================================================================
--- (empty file)
+++ logback/trunk/logback-examples/src/main/java/chapter4/conf/logback-timestamp.xml	Sun Aug  9 19:54:56 2009
@@ -0,0 +1,20 @@
+<configuration>
+
+  <!-- Insert the current time formatted as "yyyyMMdd'T'HHmmss" under
+       the key "bySecond" into the logger context. This value will be
+       available to all subsequent configuration elements. -->
+  <timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/>
+
+  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+    <!-- use the previously created timestamp to create a uniquely
+         named log file -->
+    <File>log-${bySecond}.txt</File>
+    <layout>
+      <Pattern>%logger{35} - %msg%n</Pattern>
+    </layout>
+  </appender>
+
+  <root level="debug">
+    <appender-ref ref="FILE" />
+  </root>
+</configuration>


More information about the logback-dev mailing list