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

noreply.seb at qos.ch noreply.seb at qos.ch
Fri Sep 8 11:52:05 CEST 2006


Author: seb
Date: Fri Sep  8 11:52:05 2006
New Revision: 534

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RolloverFailure.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java

Log:
Updated javadoc

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RollingFileAppender.java	Fri Sep  8 11:52:05 2006
@@ -1,5 +1,5 @@
 /**
- * LOGBack: the reliable, fast and flexible logging library for Java.
+ * Logback: the reliable, generic, fast and flexible logging framework.
  * 
  * Copyright (C) 1999-2006, QOS.ch
  * 
@@ -27,21 +27,20 @@
  * <code>RollingPolicy</code> and a <code>TriggeringPolicy</code>.
  * 
  * <p><code>RollingFileAppender</code> can be configured programattically or
- * using {@link org.apache.log4j.joran.JoranConfigurator}. Here is a sample
+ * using {@link ch.qos.logback.classic.joran.JoranConfigurator}. Here is a sample
  * configration file:
 
 <pre>&lt;?xml version="1.0" encoding="UTF-8" ?>
-&lt;!DOCTYPE log4j:configuration>
 
-&lt;log4j:configuration debug="true">
+&lt;configuration debug="true">
 
-  &lt;appender name="ROLL" class="org.apache.log4j.rolling.RollingFileAppender">
-    <b>&lt;rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
+  &lt;appender name="ROLL" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <b>&lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
       &lt;param name="FileNamePattern" value="/wombat/foo.%d{yyyy-MM}.gz"/>
     &lt;/rollingPolicy></b>
 
-    &lt;layout class="org.apache.log4j.PatternLayout">
-      &lt;param name="ConversionPattern" value="%c{1} - %m%n"/>
+    &lt;layout class="ch.qos.logback.classic.PatternLayout">
+      &lt;param name="Pattern" value="%c{1} - %m%n"/>
     &lt;/layout>     
   &lt;/appender>
 
@@ -49,7 +48,7 @@
     &lt;appender-ref ref="ROLL"/>
   &lt;/root>
  
-&lt;/log4j:configuration>
+&lt;/configuration>
 </pre>
 
  *<p>This configuration file specifies a monthly rollover schedule including

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RolloverFailure.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RolloverFailure.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/RolloverFailure.java	Fri Sep  8 11:52:05 2006
@@ -1,17 +1,11 @@
-/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ * 
+ * Copyright (C) 1999-2006, QOS.ch
+ * 
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
  */
 
 package ch.qos.logback.core.rolling;

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/rolling/TimeBasedRollingPolicy.java	Fri Sep  8 11:52:05 2006
@@ -117,6 +117,32 @@
  *   </tr>
  * </table>
  * <p>
+ * <h2>Configuration example</h2>
+ * <p>Here is a complete logback configuration xml file that uses TimeBasedTriggeringPolicy.
+ * <p>
+ * <pre>
+ * &lt;configuration&gt;
+ *  &lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
+ *    <b>&lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
+ *      &lt;param name="FileNamePattern" value="foo_%d{yyyy-MM}.log" /&gt;
+ *      &lt;param name="ActiveFileName" value="foo.log" /&gt;
+ *    &lt;/rollingPolicy&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>
+ * <p>
+ * This configuration will produce output to a file called <code>foo.log</code>. For example, at the end of the month 
+ * of September 2006, the file will be renamed to <code>foo_2006-09.log</code> and a new <code>foo.log</code> file 
+ * will be created and used for actual logging.
+ *
  * @author Ceki G&uuml;lc&uuml;
  */
 public class TimeBasedRollingPolicy extends RollingPolicyBase implements TriggeringPolicy {



More information about the logback-dev mailing list