logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1358602 - in /logging/log4j/companions/extras/trunk/src: main/java/org/apache/log4j/receivers/db/ test/java/org/apache/log4j/ test/java/org/apache/log4j/receivers/ test/java/org/apache/log4j/receivers/db/ test/resources/org/apache/log4j/re...
Date Sat, 07 Jul 2012 17:26:55 GMT
Author: sdeboy
Date: Sat Jul  7 17:26:54 2012
New Revision: 1358602

URL: http://svn.apache.org/viewvc?rev=1358602&view=rev
Log:
Fix FullCycleDBTest (https://issues.apache.org/bugzilla/show_bug.cgi?id=53519)
 - VectorAppender was in both log4j and log4j.receivers, probably a side effect of the move.
 Removed VectorAppender from log4j.receivers and fixed drivermanager xml configuration files
 - Test was also not passing because log4j logging events from DBReceiverJob were being received
by Vectorappender and threw off the count - removed the unnecessary logging
 - Also fixed an issue with the conversion pattern used by read-with-drivermanager1.xml -
to use %relative etc you have to specify an EnhancedPatternLayout instead of the standard
PatternLayout

Removed:
    logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/VectorAppender.java
Modified:
    logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java
    logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/VectorAppender.java
    logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/db/FullCycleDBTest.java
    logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/append-with-drivermanager1.xml
    logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/read-with-drivermanager1.xml

Modified: logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java?rev=1358602&r1=1358601&r2=1358602&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java
(original)
+++ logging/log4j/companions/extras/trunk/src/main/java/org/apache/log4j/receivers/db/DBReceiverJob.java
Sat Jul  7 17:26:54 2012
@@ -61,8 +61,6 @@ class DBReceiverJob extends ComponentBas
   }
 
   public void execute() {
-    getLogger().debug("DBReceiverJob.execute() called");
-
     Connection connection = null;
 
     try {

Modified: logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/VectorAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/VectorAppender.java?rev=1358602&r1=1358601&r2=1358602&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/VectorAppender.java
(original)
+++ logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/VectorAppender.java
Sat Jul  7 17:26:54 2012
@@ -53,7 +53,7 @@ public class VectorAppender extends Appe
             Thread.currentThread().sleep(100);
         } catch (Exception e) {
         }
-
+        System.out.println("Adding event - timestamp: " + event.getTimeStamp() + ": " + event.getMessage());
         vector.addElement(event);
     }
 

Modified: logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/db/FullCycleDBTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/db/FullCycleDBTest.java?rev=1358602&r1=1358601&r2=1358602&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/db/FullCycleDBTest.java
(original)
+++ logging/log4j/companions/extras/trunk/src/test/java/org/apache/log4j/receivers/db/FullCycleDBTest.java
Sat Jul  7 17:26:54 2012
@@ -25,7 +25,7 @@ import org.apache.log4j.Logger;
 import org.apache.log4j.LoggerRepositoryExImpl;
 import org.apache.log4j.MDC;
 import org.apache.log4j.component.helpers.Constants;
-import org.apache.log4j.receivers.VectorAppender;
+import org.apache.log4j.VectorAppender;
 import org.apache.log4j.spi.LocationInfo;
 import org.apache.log4j.spi.LoggerRepository;
 import org.apache.log4j.spi.LoggingEvent;
@@ -302,9 +302,9 @@ public class FullCycleDBTest
     for(Iterator i = v.iterator(); i.hasNext(); ) {
       LoggingEvent event = (LoggingEvent) i.next();  
       if(startTime > event.getTimeStamp()) {
-        System.out.println("***Removing event with timestamp "+event.getTimeStamp());
+        System.out.println("***Removing event with timestamp "+event.getTimeStamp() + ":
" + event.getMessage());
       } else {
-        System.out.println("***Keeping event with timestamo"+event.getTimeStamp());
+        System.out.println("***Keeping event with timestamp "+event.getTimeStamp() + ": "
+ event.getMessage());
         r.add(event);
       }
     }

Modified: logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/append-with-drivermanager1.xml
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/append-with-drivermanager1.xml?rev=1358602&r1=1358601&r2=1358602&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/append-with-drivermanager1.xml
(original)
+++ logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/append-with-drivermanager1.xml
Sat Jul  7 17:26:54 2012
@@ -30,7 +30,7 @@
      </connectionSource>
   </appender>
 
-  <appender name="VECTOR" class="org.apache.log4j.receivers.VectorAppender">
+  <appender name="VECTOR" class="org.apache.log4j.VectorAppender">
   </appender>
   
   <!-- Prevent internal log4j DEBUG messages from polluting the output. -->

Modified: logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/read-with-drivermanager1.xml
URL: http://svn.apache.org/viewvc/logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/read-with-drivermanager1.xml?rev=1358602&r1=1358601&r2=1358602&view=diff
==============================================================================
--- logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/read-with-drivermanager1.xml
(original)
+++ logging/log4j/companions/extras/trunk/src/test/resources/org/apache/log4j/receivers/db/read-with-drivermanager1.xml
Sat Jul  7 17:26:54 2012
@@ -21,7 +21,7 @@
 <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/' debug="true">
 	  
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-     <layout class="org.apache.log4j.PatternLayout">
+     <layout class="org.apache.log4j.EnhancedPatternLayout">
        <param name="ConversionPattern" value="READING %relative %level %logger - %message%n"/>
      </layout>
   </appender>
@@ -29,8 +29,8 @@
   <appender name="VECTOR" class="org.apache.log4j.VectorAppender">
   </appender>
   
-  <plugin name="DB" class="org.apache.log4j.db.DBReceiver">
-     <connectionSource class="org.apache.log4j.db.DriverManagerConnectionSource">
+  <plugin name="DB" class="org.apache.log4j.receivers.db.DBReceiver">
+     <connectionSource class="org.apache.log4j.receivers.db.DriverManagerConnectionSource">
        <param name="driverClass" value="org.hsqldb.jdbcDriver"/>
        <param name="url" value="jdbc:hsqldb:mem:testdb"/>
        <param name="user" value="sa"/>



Mime
View raw message