logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: jakarta-log4j/tests/src/java/org/apache/log4j/rolling SizeBasedRollingTestCase.java
Date Sat, 17 May 2003 15:47:07 GMT
ceki        2003/05/17 08:47:07

  Modified:    src/java/org/apache/log4j/rolling
                        SizeBasedTriggeringPolicy.java
               tests/src/java/org/apache/log4j/rolling
                        SizeBasedRollingTestCase.java
  Log:
  Small improvements.
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-log4j/src/java/org/apache/log4j/rolling/SizeBasedTriggeringPolicy.java
  
  Index: SizeBasedTriggeringPolicy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/rolling/SizeBasedTriggeringPolicy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SizeBasedTriggeringPolicy.java	17 May 2003 14:30:03 -0000	1.2
  +++ SizeBasedTriggeringPolicy.java	17 May 2003 15:47:07 -0000	1.3
  @@ -63,7 +63,7 @@
   
     public boolean isTriggeringEvent(File file) {
       System.out.print("Size: "+ file.length());
  -    return (file.length() > maxFileSize);
  +    return (file.length() >= maxFileSize);
     }
   
     public long getMaxFileSize() {
  
  
  
  1.2       +7 -5      jakarta-log4j/tests/src/java/org/apache/log4j/rolling/SizeBasedRollingTestCase.java
  
  Index: SizeBasedRollingTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/tests/src/java/org/apache/log4j/rolling/SizeBasedRollingTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SizeBasedRollingTestCase.java	16 May 2003 11:36:20 -0000	1.1
  +++ SizeBasedRollingTestCase.java	17 May 2003 15:47:07 -0000	1.2
  @@ -85,23 +85,25 @@
       rfa.setLayout(layout);
       SlidingWindowRollingPolicy swrp = new SlidingWindowRollingPolicy();
       SizeBasedTriggeringPolicy sbtp = new SizeBasedTriggeringPolicy();
  -    sbtp.setMaxFileSize(1000);
  +    sbtp.setMaxFileSize(100);
       swrp.setFileNamePattern("output/test.%i");
       rfa.setRollingPolicy(swrp);
       rfa.setTriggeringPolicy(sbtp);
       //rfa.setFile("test");
       rfa.activateOptions();
  -    logger.addAppender(rfa);
  +    root.addAppender(rfa);
       
   
  -    for (int i = 0; i < 1000; i++) {
  +    for (int i = 0; i < 69; i++) {
         try {
           Thread.sleep(10);
         } catch(Exception e) {}
         if (i < 10) {
  -        logger.debug("Hello   " + i);
  +        logger.debug("Hello---" + i);
  +      } else if (i < 100) {
  +        logger.debug("Hello--" + i);
         } else {
  -        logger.debug("Hello  " + i);
  +        logger.debug("Hello-" + i);
         }
       }
     }
  
  
  

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


Mime
View raw message