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/chainsaw/layout EventDetailLayout.java LayoutEditorPane.java
Date Mon, 10 May 2004 09:48:54 GMT
ceki        2004/05/10 02:48:54

  Modified:    src/java/org/apache/log4j/chainsaw/layout
                        EventDetailLayout.java LayoutEditorPane.java
  Log:
  - Modified UtilLoggingXMLDecoder and XMLDecoder to conform to the
  LoggingEvent setter API.
  - Continued work on DBAppender
  
  Revision  Changes    Path
  1.8       +28 -22    logging-log4j/src/java/org/apache/log4j/chainsaw/layout/EventDetailLayout.java
  
  Index: EventDetailLayout.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/layout/EventDetailLayout.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EventDetailLayout.java	9 May 2004 18:37:57 -0000	1.7
  +++ EventDetailLayout.java	10 May 2004 09:48:54 -0000	1.8
  @@ -184,37 +184,43 @@
       String threadName = event.getThreadName();
       Object msg = event.getMessage();
       String ndc = event.getNDC();
  -    Hashtable mdc = formatMDC(event);
  +//    Hashtable mdc = formatMDC(event);
       String[] throwableStringRep = event.getThrowableStrRep();
       LocationInfo li = null;
       if (event.locationInformationExists()) {
           li = formatLocationInfo(event);
       }
       Hashtable properties = formatProperties(event);
  -    LoggingEvent copy =
  -      new LoggingEvent(
  -        fqnCategory, logger, event.getTimeStamp(), event.getLevel(), threadName, msg,
  -        ndc, mdc, throwableStringRep, li, properties);
  -
  +    LoggingEvent copy = new LoggingEvent();
  +    copy.setLogger(logger);
  +    copy.setTimeStamp(event.getTimeStamp());
  +    copy.setLevel(event.getLevel());
  +    copy.setThreadName(threadName);
  +    copy.setMessage(msg);
  +    copy.setNDC(ndc);
  +    copy.setThrowableInformation(event.getThrowableInformation());
  +    copy.setLocationInformation(li);
  +    copy.setProperties(properties);
  +    
       return copy;
     }
   
  -  /**
  -  * @param event
  -  * @return
  -  */
  -  private static Hashtable formatMDC(LoggingEvent event) {
  -    Set keySet = event.getMDCKeySet();
  -    Hashtable hashTable = new Hashtable();
  -
  -    for (Iterator iter = keySet.iterator(); iter.hasNext();) {
  -      Object key = (Object) iter.next();
  -      Object value = event.getMDC(key.toString());
  -      hashTable.put(escape(key.toString()), escape(value.toString()));
  -    }
  -
  -    return hashTable;
  -  }
  +//  /**
  +//  * @param event
  +//  * @return
  +//  */
  +//  private static Hashtable formatMDC(LoggingEvent event) {
  +//    Set keySet = event.getMDCKeySet();
  +//    Hashtable hashTable = new Hashtable();
  +//
  +//    for (Iterator iter = keySet.iterator(); iter.hasNext();) {
  +//      Object key = (Object) iter.next();
  +//      Object value = event.getMDC(key.toString());
  +//      hashTable.put(escape(key.toString()), escape(value.toString()));
  +//    }
  +//
  +//    return hashTable;
  +//  }
   
     /**
      * @param event
  
  
  
  1.4       +11 -6     logging-log4j/src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
  
  Index: LayoutEditorPane.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LayoutEditorPane.java	27 Feb 2004 16:47:31 -0000	1.3
  +++ LayoutEditorPane.java	10 May 2004 09:48:54 -0000	1.4
  @@ -180,12 +180,17 @@
   
       ThrowableInformation tsr = new ThrowableInformation(new Exception());
   
  -    event =
  -      new LoggingEvent(
  -        "com.mycompany.mylogger", Logger.getLogger("com.mycompany.mylogger"),
  -        new Date().getTime(), org.apache.log4j.Level.DEBUG, "Thread-1",
  -        "The quick brown fox jumped over the lazy dog", "NDC string", hashTable,
  -        tsr.getThrowableStrRep(), li, hashTable);
  +    event = new LoggingEvent();
  +    event.setLogger(Logger.getLogger("com.mycompany.mylogger"));
  +    event.setTimeStamp(new Date().getTime());
  +    event.setLevel(org.apache.log4j.Level.DEBUG);
  +    event.setThreadName("Thread-1");
  +    event.setMessage("The quick brown fox jumped over the lazy dog");
  +    event.setNDC("NDC string");
  +    event.setThrowableInformation(tsr);
  +    event.setLocationInformation(li);
  +    event.setProperties(hashTable);
  +    
     }
   
     /**
  
  
  

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