logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j DailyRollingFileAppender.java
Date Fri, 28 May 2004 18:13:37 GMT
ceki        2004/05/28 11:13:36

  Modified:    src/java/org/apache/log4j DailyRollingFileAppender.java
  Log:
  Docs changes. See bug 18393 
    http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18393
  
  Removed the comment disabling the creation of the sdf variable.
  
  Revision  Changes    Path
  1.28      +14 -11    logging-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java
  
  Index: DailyRollingFileAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/DailyRollingFileAppender.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DailyRollingFileAppender.java	10 May 2004 09:40:31 -0000	1.27
  +++ DailyRollingFileAppender.java	28 May 2004 18:13:36 -0000	1.28
  @@ -41,7 +41,7 @@
   
      <p>For example, if the <b>File</b> option is set to
      <code>/foo/bar.log</code> and the <b>DatePattern</b> set to
  -   <code>'.'yyyy-MM-dd</code>, on 2001-02-16 at midnight, the logging
  +   <code>.yyyy-MM-dd</code>, on 2001-02-16 at midnight, the logging
      file <code>/foo/bar.log</code> will be copied to
      <code>/foo/bar.log.2001-02-16</code> and logging for 2001-02-17
      will continue in <code>/foo/bar.log</code> until it rolls over
  @@ -57,7 +57,7 @@
      <th>Example</th>
   
      <tr>
  -   <td><code>'.'yyyy-MM</code>
  +   <td><code>.yyyy-MM</code>
      <td>Rollover at the beginning of each month</td>
   
      <td>At midnight of May 31st, 2002 <code>/foo/bar.log</code> will be
  @@ -66,7 +66,7 @@
      also rolled over the next month.
   
      <tr>
  -   <td><code>'.'yyyy-ww</code>
  +   <td><code>.yyyy-ww</code>
   
      <td>Rollover at the first day of each week. The first day of the
      week depends on the locale.</td>
  @@ -78,7 +78,7 @@
      rolled over the next week.
   
      <tr>
  -   <td><code>'.'yyyy-MM-dd</code>
  +   <td><code>.yyyy-MM-dd</code>
   
      <td>Rollover at midnight each day.</td>
   
  @@ -88,7 +88,7 @@
      is rolled over the next day.
   
      <tr>
  -   <td><code>'.'yyyy-MM-dd-a</code>
  +   <td><code>.yyyy-MM-dd-a</code>
   
      <td>Rollover at midnight and midday of each day.</td>
   
  @@ -98,7 +98,7 @@
      until it is rolled over at midnight.
   
      <tr>
  -   <td><code>'.'yyyy-MM-dd-HH</code>
  +   <td><code>.yyyy-MM-dd-HH</code>
   
      <td>Rollover at the top of every hour.</td>
   
  @@ -110,7 +110,7 @@
   
   
      <tr>
  -   <td><code>'.'yyyy-MM-dd-HH-mm</code>
  +   <td><code>.yyyy-MM-dd-HH-mm</code>
   
      <td>Rollover at the beginning of every minute.</td>
   
  @@ -140,9 +140,9 @@
   
     /**
        The date pattern. By default, the pattern is set to
  -     "'.'yyyy-MM-dd" meaning daily rollover.
  +     ".yyyy-MM-dd" meaning daily rollover.
      */
  -  private String datePattern = "'.'yyyy-MM-dd";
  +  private String datePattern = ".yyyy-MM-dd";
   
     /**
        The log file will be renamed to the value of the
  @@ -202,12 +202,15 @@
       if ((datePattern != null) && (fileName != null)) {
         now.setTime(System.currentTimeMillis());
   
  -      //sdf = new SimpleDateFormat(datePattern);
  +      sdf = new SimpleDateFormat(datePattern);
         int type = rc.computeTriggeringPeriod(datePattern);
         rc.printPeriodicity();
         rc.setType(type);
   
         File file = new File(fileName);
  +      LogLog.info("fileane is "+fileName);
  +      LogLog.info("sdf is "+sdf);
  +      
         scheduledFilename = fileName + sdf.format(new Date(file.lastModified()));
       } else {
         LogLog.error(
  @@ -221,7 +224,7 @@
     /**
        Rollover the current file to a new file.
     */
  -  void rollOver() throws IOException {
  +  public void rollOver() throws IOException {
       /* Compute filename, but only if datePattern is specified */
       if (datePattern == null) {
         errorHandler.error("Missing DatePattern option in rollOver().");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message