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/db DBAppender.java
Date Mon, 10 May 2004 09:40:08 GMT
ceki        2004/05/10 02:40:08

  Modified:    src/java/org/apache/log4j/xml UtilLoggingXMLDecoder.java
                        XMLDecoder.java
               src/java/org/apache/log4j/db DBAppender.java
  Log:
  - Modified UtilLoggingXMLDecoder and XMLDecoder to conform to the
  LoggingEvent setter API.
  - Continued work on DBAppender
  
  Revision  Changes    Path
  1.9       +14 -6     logging-log4j/src/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java
  
  Index: UtilLoggingXMLDecoder.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/UtilLoggingXMLDecoder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- UtilLoggingXMLDecoder.java	14 Apr 2004 05:38:12 -0000	1.8
  +++ UtilLoggingXMLDecoder.java	10 May 2004 09:40:08 -0000	1.9
  @@ -37,6 +37,7 @@
   import org.apache.log4j.UtilLoggingLevel;
   import org.apache.log4j.spi.LocationInfo;
   import org.apache.log4j.spi.LoggingEvent;
  +import org.apache.log4j.spi.ThrowableInformation;
   import org.w3c.dom.Document;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  @@ -366,12 +367,19 @@
         if ((fileName != null) || (className != null) || (methodName != null) || (lineNumber
!= null)) {
             info = new LocationInfo(fileName, className, methodName, lineNumber);
         } 
  -      events.add(
  -        new LoggingEvent(
  -          logger.getName(), logger, timeStamp, level, threadName, message, ndc,
  -          mdc, exception,
  -          info,
  -          properties));
  +      
  +      LoggingEvent loggingEvent = new LoggingEvent();
  +      loggingEvent.setLogger(logger);
  +      loggingEvent.setTimeStamp(timeStamp);
  +      loggingEvent.setLevel(level);
  +      loggingEvent.setThreadName(threadName);
  +      loggingEvent.setMessage(message);
  +      loggingEvent.setNDC(ndc);
  +      loggingEvent.setThrowableInformation(new ThrowableInformation(exception));
  +      loggingEvent.setLocationInformation(info);
  +      loggingEvent.setProperties(properties);
  +      
  +      events.add(loggingEvent);
   
         logger = null;
         timeStamp = 0L;
  
  
  
  1.10      +15 -6     logging-log4j/src/java/org/apache/log4j/xml/XMLDecoder.java
  
  Index: XMLDecoder.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/XMLDecoder.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- XMLDecoder.java	28 Mar 2004 10:04:31 -0000	1.9
  +++ XMLDecoder.java	10 May 2004 09:40:08 -0000	1.10
  @@ -36,6 +36,7 @@
   import org.apache.log4j.UtilLoggingLevel;
   import org.apache.log4j.spi.LocationInfo;
   import org.apache.log4j.spi.LoggingEvent;
  +import org.apache.log4j.spi.ThrowableInformation;
   import org.w3c.dom.Document;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  @@ -377,12 +378,20 @@
         if ((fileName != null) || (className != null) || (methodName != null) || (lineNumber
!= null)) {
             info = new LocationInfo(fileName, className, methodName, lineNumber);
         } 
  -      events.add(
  -        new LoggingEvent(
  -          logger.getName(), logger, timeStamp, levelImpl, threadName, message, ndc,
  -          mdc, exception,
  -          info,
  -          properties));
  +      
  +      LoggingEvent loggingEvent = new LoggingEvent();
  +      loggingEvent.setLogger(logger);
  +      loggingEvent.setTimeStamp(timeStamp);
  +      loggingEvent.setLevel(levelImpl);
  +      loggingEvent.setThreadName(threadName);
  +      loggingEvent.setMessage(message);
  +      loggingEvent.setNDC(ndc);
  +      loggingEvent.setThrowableInformation(new ThrowableInformation(exception));
  +      loggingEvent.setLocationInformation(info);
  +      loggingEvent.setProperties(properties);
  +      
  +      events.add(loggingEvent);
  +     
         logger = null;
         timeStamp = 0L;
         level = null;
  
  
  
  1.4       +2 -2      logging-log4j/src/java/org/apache/log4j/db/DBAppender.java
  
  Index: DBAppender.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/db/DBAppender.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DBAppender.java	10 May 2004 09:30:17 -0000	1.3
  +++ DBAppender.java	10 May 2004 09:40:08 -0000	1.4
  @@ -109,7 +109,7 @@
         insertStatement.setString(5, event.getLevel().toString());
         insertStatement.setString(6, event.getNDC());
         insertStatement.setString(7, event.getThreadName());
  -      insertStatement.setString(8, computeFlag(event));
  +      insertStatement.setShort(8, computeFlag(event, propertiesKeys, throwableStrRep));
         
         int updateCount = insertStatement.executeUpdate();
   
  @@ -153,7 +153,7 @@
     }
   
   
  -  short computeFlag(LoggingEvent event) {
  +  short computeFlag(LoggingEvent event, Set propertyJeys, String[] strRep) {
   
       return 0;
     }
  
  
  

---------------------------------------------------------------------
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