You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ps...@apache.org on 2003/05/01 01:23:36 UTC

cvs commit: jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw FileLoadAction.java

psmith      2003/04/30 16:23:36

  Modified:    src/java/org/apache/log4j/chainsaw FileLoadAction.java
  Log:
  Ensured that the decoding process knows about the location of
  where these events came from by adding the LOGJ_MACHINE_NAME
  property with a value of "localhost:<filename>".  This means
  the events froma particular file get they're own tab.
  
  Revision  Changes    Path
  1.3       +5 -1      jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/FileLoadAction.java
  
  Index: FileLoadAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/FileLoadAction.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileLoadAction.java	30 Apr 2003 08:47:29 -0000	1.2
  +++ FileLoadAction.java	30 Apr 2003 23:23:36 -0000	1.3
  @@ -8,6 +8,8 @@
   import java.awt.event.KeyEvent;
   import java.io.File;
   import java.io.IOException;
  +import java.util.HashMap;
  +import java.util.Map;
   import java.util.Vector;
   
   import javax.swing.AbstractAction;
  @@ -71,9 +73,11 @@
       
       if (selectedFile != null) {
         XMLDecoder decoder = new XMLDecoder();
  +      Map additionalProperties = new HashMap();
  +      additionalProperties.put(LogUI.LOG4J_MACHINE_KEY, "localhost:" + selectedFile.getName());
  +      decoder.setAdditionalProperties(additionalProperties);
         try {
           Vector events = decoder.decode(selectedFile);
  -        // TODO Ensure the events have location info
           parent.handler.appendBatch(events);
         } catch (IOException e1) {
           // TODO Handle the error with a nice msg
  
  
  

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