ceki        2004/05/15 11:22:57

  Modified:    src/java/org/apache/joran/action ParamAction.java
                        Action.java
               log4jMini/src/java/org/apache/log4j Hierarchy.java
                        Category.java
               src/java/org/apache/log4j Hierarchy.java LogManager.java
                        Category.java
               examples/tiny-webapp/Hello/src/java/wombat InitServlet.java
               tests/src/java/org/apache/log4j LoggerTestCase.java
               src/java/org/apache/joran ExecutionContext.java
               examples/tiny-webapp/Tata/src/java/wombat InitServlet.java
               src/java/org/apache/log4j/net SocketServer.java
               src/java/org/apache/log4j/joran JoranConfigurator.java
               tests/src/java/org/apache/log4j/plugins PluginTestCase.java
               src/java/org/apache/log4j/selector ContextJNDISelector.java
  Added:       tests/src/java/org/apache/log4j/db FullCycleDBTest.java
               src/java/org/apache/log4j/spi RootLogger.java
               src/java/org/apache/log4j/joran/action PropertyAction.java
  Removed:     src/java/org/apache/log4j/spi RootCategory.java
  Log:
  - Renamed RootCategory to RootLogger

  - Added support for variable name substitution in Joran. There is a new

  PropertyAction which will add key=value pairs for substitutions.

  
  Revision  Changes    Path
  1.9       +1 -1      logging-log4j/src/java/org/apache/joran/action/ParamAction.java
  
  Index: ParamAction.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/joran/action/ParamAction.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ParamAction.java  9 Apr 2004 14:03:48 -0000       1.8
  +++ ParamAction.java  15 May 2004 18:22:56 -0000      1.9
  @@ -33,10 +33,10 @@
                        return;
                }
       
  -    logger.debug("Setting parameter ["+name+"] to value ["+value+"].");
                Object o = ec.peekObject();
                PropertySetter propSetter = new PropertySetter(o);              
                value = ec.subst(OptionConverter.convertSpecialChars(value));
  +    logger.debug("Setting parameter ["+name+"] to value ["+value+"].");
                propSetter.setProperty(name, value);
     }
   
  
  
  
  1.13      +1 -0      logging-log4j/src/java/org/apache/joran/action/Action.java
  
  Index: Action.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/joran/action/Action.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Action.java       9 Apr 2004 14:03:48 -0000       1.12
  +++ Action.java       15 May 2004 18:22:56 -0000      1.13
  @@ -39,6 +39,7 @@
   public abstract class Action {
     public static final String NAME_ATTRIBUTE = "name";
     public static final String VALUE_ATTRIBUTE = "value";
  +  public static final String FILE_ATTRIBUTE = "value";
     public static final String CLASS_ATTRIBUTE = "class";
     public static final String PATTERN_ATTRIBUTE = "pattern";
     public static final String ACTION_CLASS_ATTRIBUTE = "actionClass";
  
  
  
  1.2       +1 -1      logging-log4j/log4jMini/src/java/org/apache/log4j/Hierarchy.java
  
  Index: Hierarchy.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/log4jMini/src/java/org/apache/log4j/Hierarchy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Hierarchy.java    9 Jan 2003 10:57:08 -0000       1.1
  +++ Hierarchy.java    15 May 2004 18:22:56 -0000      1.2
  @@ -22,7 +22,7 @@
   import java.util.Enumeration;
   import java.util.Vector;
   
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   import org.apache.log4j.Appender;
   import org.apache.log4j.helpers.LogLog;
   
  
  
  
  1.2       +1 -1      logging-log4j/log4jMini/src/java/org/apache/log4j/Category.java
  
  Index: Category.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/log4jMini/src/java/org/apache/log4j/Category.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Category.java     9 Jan 2003 10:57:08 -0000       1.1
  +++ Category.java     15 May 2004 18:22:56 -0000      1.2
  @@ -21,7 +21,7 @@
   package org.apache.log4j;
   
   import org.apache.log4j.Priority;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   import org.apache.log4j.spi.LoggingEvent;
   import org.apache.log4j.helpers.LogLog;
   
  
  
  
  1.52      +1 -1      logging-log4j/src/java/org/apache/log4j/Hierarchy.java
  
  Index: Hierarchy.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Hierarchy.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- Hierarchy.java    9 May 2004 18:37:56 -0000       1.51
  +++ Hierarchy.java    15 May 2004 18:22:56 -0000      1.52
  @@ -16,7 +16,7 @@
   
   
   // WARNING This class MUST not have references to the Category or
  -// WARNING RootCategory classes in its static initiliazation neither
  +// WARNING RootLogger classes in its static initiliazation neither
   // WARNING directly nor indirectly.
   package org.apache.log4j;
   
  
  
  
  1.22      +2 -2      logging-log4j/src/java/org/apache/log4j/LogManager.java
  
  Index: LogManager.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/LogManager.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- LogManager.java   22 Apr 2004 20:07:29 -0000      1.21
  +++ LogManager.java   15 May 2004 18:22:56 -0000      1.22
  @@ -26,7 +26,7 @@
   import org.apache.log4j.spi.LoggerFactory;
   import org.apache.log4j.spi.LoggerRepository;
   import org.apache.log4j.spi.RepositorySelector;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   
   import java.util.Enumeration;
   
  @@ -47,7 +47,7 @@
     
     static {
       System.out.println("**Start of LogManager static initializer");
  -    Hierarchy defaultHierarchy = new Hierarchy(new RootCategory(Level.DEBUG));
  +    Hierarchy defaultHierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
       defaultHierarchy.setName("default");
   
       String repositorySelectorStr =
  
  
  
  1.81      +1 -1      logging-log4j/src/java/org/apache/log4j/Category.java
  
  Index: Category.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/Category.java,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- Category.java     12 May 2004 15:39:04 -0000      1.80
  +++ Category.java     15 May 2004 18:22:56 -0000      1.81
  @@ -99,7 +99,7 @@
     //static
     //public
     //final Hierarchy defaultHierarchy = new Hierarchy(new
  -  //                                    RootCategory(Level.DEBUG));
  +  //                                    RootLogger(Level.DEBUG));
   
     /**
      * The name of this category.
  
  
  
  1.2       +1 -1      
logging-log4j/examples/tiny-webapp/Hello/src/java/wombat/InitServlet.java
  
  Index: InitServlet.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/examples/tiny-webapp/Hello/src/java/wombat/InitServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InitServlet.java  27 Mar 2004 17:31:56 -0000      1.1
  +++ InitServlet.java  15 May 2004 18:22:57 -0000      1.2
  @@ -1,7 +1,7 @@
   package wombat;
   
   import org.apache.log4j.*;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   import javax.servlet.http.*;
   import javax.servlet.*;
   
  
  
  
  1.7       +1 -1      
logging-log4j/tests/src/java/org/apache/log4j/LoggerTestCase.java
  
  Index: LoggerTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/tests/src/java/org/apache/log4j/LoggerTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LoggerTestCase.java       27 Feb 2004 16:47:36 -0000      1.6
  +++ LoggerTestCase.java       15 May 2004 18:22:57 -0000      1.7
  @@ -335,7 +335,7 @@
     }
   
     public void testHierarchy1() {
  -    Hierarchy h = new Hierarchy(new RootCategory((Level) Level.ERROR));
  +    Hierarchy h = new Hierarchy(new RootLogger((Level) Level.ERROR));
       Logger a0 = h.getLogger("a");
       assertEquals("a", a0.getName());
       assertNull(a0.getLevel());
  
  
  
  1.1                  
logging-log4j/tests/src/java/org/apache/log4j/db/FullCycleDBTest.java
  
  Index: FullCycleDBTest.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.log4j.db;
  
  import java.io.BufferedReader;
  import java.io.FileInputStream;
  import java.io.InputStreamReader;
  import java.util.Hashtable;
  import java.util.Properties;
  
  import javax.naming.Context;
  import javax.naming.InitialContext;
  
  import junit.framework.TestCase;
  
  import org.apache.log4j.BasicConfigurator;
  import org.apache.log4j.Hierarchy;
  import org.apache.log4j.LogManager;
  import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
  import org.apache.log4j.helpers.IntializationUtil;
  import org.apache.log4j.helpers.LogLog;
  import org.apache.log4j.joran.JoranConfigurator;
  import org.apache.log4j.spi.LoggerRepository;
  import org.apache.log4j.spi.RootLogger;
  
  
  /**
   * @author Ceki Gülcü
   *
   */
  public class FullCycleDBTest
         extends TestCase {
    /*
     * @see TestCase#setUp()
     */
    protected void setUp()
           throws Exception {
      super.setUp();
    }
  
  
    /*
     * @see TestCase#tearDown()
     */
    protected void tearDown()
           throws Exception {
      super.tearDown();
    }
  
    /**
     * Constructor for DBReeceiverTest.
     * @param arg0
     */
    public FullCycleDBTest(String arg0) {
      super(arg0);
    }
  
    public void testBasic()
           throws Exception {
  
      BasicConfigurator.configure();
      LogLog.setInternalDebugging(true);
      LoggerRepository lrWrite = new Hierarchy(new RootLogger(Level.DEBUG));
      
      IntializationUtil.log4jInternalConfiguration(lrWrite);
    
      
      LoggerRepository lrRead = new Hierarchy(new RootLogger(Level.DEBUG));
     
      Properties props = new Properties();
      FileInputStream istream = new FileInputStream("input/db/db.properties");
      props.load(istream);
      istream.close();
      JoranConfigurator jc = new JoranConfigurator();
      jc.getExecutionContext().addProperties(props);
      jc.doConfigure("input/db/writeCS1.xml", lrWrite);
    
  
      Logger out = lrWrite.getLogger("test");
      out.debug("test1");
      
      
      
  //    UrlConnectionSource connectionSource = new UrlConnectionSource();
  //    connectionSource.setDriverClass("com.mysql.jdbc.Driver");
  //    connectionSource.setUrl("jdbc:mysql:///test");
  //    connectionSource.setUser("root");
  //    LogLog.info("xxxxxxx");
  //
  //    DBReceiver dbReceiver = new DBReceiver();
  //    dbReceiver.setLoggerRepository(LogManager.getLoggerRepository());
  //    dbReceiver.setConnectionSource(connectionSource);
  //    dbReceiver.activateOptions();
  //    LogLog.info("after  dbReceiver.activateOptions()");
  
  //    try {
  //      Thread.sleep(3000);
  //    } catch (Exception e) {
  //    }
      //dbReceiver.shutdown();
      LogLog.info("after  dbReceiver.shutdown()");
  
      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
      while (true) {
        System.out.println("Type a message to send to log server. Type 'q' to quit.");
        String s = reader.readLine();
        if (s.equals("q")) {
          break;
        } else {
        }
      }
      LogManager.getLoggerRepository().shutdown();
    }
  
  
    public void xtestJNDI()
           throws Exception {
      Hashtable env = new Hashtable();
  
      env.put(Context.INITIAL_CONTEXT_FACTORY, 
"com.sun.jndi.fscontext.RefFSContextFactory");
      env.put(Context.PROVIDER_URL, "file:///home/jndi");
  
      Context ctx = new InitialContext(env);
  
      //ctx.addToEnvironment("toto", new Integer(1));
      ctx.bind("toto", new Integer(1));
    }
  }
  
  
  
  1.1                  logging-log4j/src/java/org/apache/log4j/spi/RootLogger.java
  
  Index: RootLogger.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.log4j.spi;
  
  import org.apache.log4j.*;
  import org.apache.log4j.helpers.LogLog;
  
  
  // Contibutors: Mathias Bogaert
  
  /**
     RootLogger sits at the top of the category hierachy. It is a
     regular logger except that it provides several guarantees.
  
     <p>First, it cannot be assigned a <code>null</code>
     level. Second, since root logger cannot have a parent, the
     [EMAIL PROTECTED] #getChainedLevel} method always returns the value of the
     level field without walking the hierarchy.
  
     @author Ceki G&uuml;lc&uuml;
  
   */
  public final class RootLogger extends Logger {
    /**
       The root category names itself as "root". However, the root
       category cannot be retrieved by name.
    */
    public RootLogger(Level level) {
      super("root");
      setLevel(level);
    }
  
    /**
       Return the assigned level value without walking the category
       hierarchy.
    */
    public final Level getChainedLevel() {
      return level;
    }
  
    /**
       Setting a null value to the level of the root logger may have catastrophic
       results. We prevent this here.
  
       @since 0.8.3 */
    public final void setLevel(Level level) {
      if (level == null) {
        LogLog.error(
          "You have tried to set a null level to root.", new Throwable());
      } else {
        this.level = level;
      }
    }
  
  }
  
  
  
  1.7       +76 -45    logging-log4j/src/java/org/apache/joran/ExecutionContext.java
  
  Index: ExecutionContext.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/joran/ExecutionContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ExecutionContext.java     9 Apr 2004 14:03:48 -0000       1.6
  +++ ExecutionContext.java     15 May 2004 18:22:57 -0000      1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 1999,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -16,16 +16,19 @@
   
   package org.apache.joran;
   
  +import org.apache.log4j.Logger;
  +import org.apache.log4j.helpers.LogLog;
  +import org.apache.log4j.helpers.OptionConverter;
  +
  +import org.xml.sax.Locator;
  +
   import java.util.HashMap;
  +import java.util.Iterator;
   import java.util.List;
   import java.util.Properties;
   import java.util.Stack;
   import java.util.Vector;
   
  -import org.apache.log4j.Logger;
  -import org.apache.log4j.helpers.OptionConverter;
  -import org.xml.sax.Locator;
  -
   
   /**
    *
  @@ -33,31 +36,31 @@
    *
    */
   public class ExecutionContext {
  -     final static Logger logger = Logger.getLogger(ExecutionContext.class);
  -
  +  static final Logger logger = Logger.getLogger(ExecutionContext.class);
     Stack objectStack;
  -     HashMap objectMap;
  -     
  -     Vector errorList;
  -     Properties substProperties;
  -     
  -     Interpreter joranInterpreter;
  -    
  -     public ExecutionContext(Interpreter joranInterpreter) {
  -             this.joranInterpreter = joranInterpreter;
  -             objectStack = new Stack();
  -             objectMap = new HashMap(5);
  -             errorList = new Vector();
  -     }
  -     
  -     public void addError(ErrorItem errorItem) {
  +  HashMap objectMap;
  +  Vector errorList;
  +  Properties substitutionProperties;
  +  Interpreter joranInterpreter;
  +
  +  public ExecutionContext(Interpreter joranInterpreter) {
  +    this.joranInterpreter = joranInterpreter;
  +    objectStack = new Stack();
  +    objectMap = new HashMap(5);
  +    errorList = new Vector();
  +    substitutionProperties = new Properties();
  +  }
  +
  +  public void addError(ErrorItem errorItem) {
       Locator locator = joranInterpreter.getLocator();
  +
       if (locator != null) {
         errorItem.setLineNumber(locator.getLineNumber());
         errorItem.setColNumber(locator.getColumnNumber());
       }
  -             errorList.add(errorItem);
  -     }
  +
  +    errorList.add(errorItem);
  +  }
   
     public List getErrorList() {
       return errorList;
  @@ -66,6 +69,7 @@
     public Locator getLocator() {
       return joranInterpreter.getLocator();
     }
  +
     public Interpreter getJoranInterpreter() {
       return joranInterpreter;
     }
  @@ -74,34 +78,61 @@
       return objectStack;
     }
   
  -     public Object peekObject() {
  -             return objectStack.peek();
  -     }
  +  public Object peekObject() {
  +    return objectStack.peek();
  +  }
   
     public void pushObject(Object o) {
  -             objectStack.push(o);
  +    objectStack.push(o);
     }
  -  
  +
     public Object popObject() {
  -    return   objectStack.pop();
  +    return objectStack.pop();
     }
  -  
  +
     public Object getObject(int i) {
  -             return objectStack.get(i);
  +    return objectStack.get(i);
     }
  - 
  +
     public HashMap getObjectMap() {
       return objectMap;
     }
  -  
  -     public String subst(String value) {
  -             try {
  -                     return OptionConverter.substVars(value, substProperties);
  -             } catch (IllegalArgumentException e) {
  -                     logger.warn("Could not perform variable substitution for 
variable ["
  -                     +value+"]", e);
  -                     return value;
  -             }
  -     }
   
  +  /**
  +   * Add a property to the properties of this execution context.
  +   * If the property exists already, it is overwritten.
  +   */
  +  public void addProperty(String key, String value) {
  +    if (substitutionProperties.contains(key)) {
  +      LogLog.warn(
  +        "key [" + key
  +        + "] already contained in the EC properties. Overwriting.");
  +    }
  +
  +    substitutionProperties.put(key, value);
  +  }
  +
  + public void addProperties(Properties props) {
  +    if(props == null) {
  +      return;
  +    }
  +    Iterator i = props.keySet().iterator();
  +    while(i.hasNext()) {
  +      String key = (String) i.next();
  +      LogLog.debug("Adding property ["+key+"="+props.getProperty(key)+"]");
  +      addProperty(key, props.getProperty(key));
  +    }
  +  }
  +
  +  public String subst(String value) {
  +    try {
  +      return OptionConverter.substVars(value, substitutionProperties);
  +    } catch (IllegalArgumentException e) {
  +      logger.warn(
  +        "Could not perform variable substitution for variable [" + value + "]",
  +        e);
  +
  +      return value;
  +    }
  +  }
   }
  
  
  
  1.1                  
logging-log4j/src/java/org/apache/log4j/joran/action/PropertyAction.java
  
  Index: PropertyAction.java
  ===================================================================
  /*
   * Copyright 1999,2004 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package org.apache.log4j.joran.action;
  
  import org.apache.joran.ErrorItem;
  import org.apache.joran.ExecutionContext;
  import org.apache.joran.action.Action;
  import org.apache.joran.helper.Option;
  
  import org.apache.log4j.Logger;
  import org.apache.log4j.helpers.LogLog;
  import org.apache.log4j.helpers.OptionConverter;
  
  import org.xml.sax.Attributes;
  
  import java.io.FileInputStream;
  import java.io.IOException;
  
  import java.util.Properties;
  
  /**
   * Set a new property for the execution context by name, value pair, or adds
   * all the properties found in the specified file.
   * 
   * Similar to the ANT <property> task.
   * @author Ceki G&uuml;lc&uuml;
   */
  public class PropertyAction extends Action {
    static final Logger logger = Logger.getLogger(PropertyAction.class);
    static String INVALID_ATTRIBUTES =
      "In <property> element, either the filename attribute or both the name and value 
attributes must be set.";
  
    /**
     * Set a new property for the execution context by name, value pair, or adds
     * all the properties found in the given file.
     *
     */
    public void begin(
      ExecutionContext ec, String localName, Attributes attributes) {
      String name = attributes.getValue(NAME_ATTRIBUTE);
      String value = attributes.getValue(NAME_ATTRIBUTE);
      String fileName = attributes.getValue(FILE_ATTRIBUTE);
  
      if (
        !Option.isEmpty(fileName)
          && (Option.isEmpty(name) && Option.isEmpty(value))) {
        Properties props = new Properties();
  
        try {
          FileInputStream istream = new FileInputStream(fileName);
          props.load(istream);
          istream.close();
        } catch (IOException e) {
          String errMsg = "Could not read properties file [" + fileName + "].";
          LogLog.error(errMsg, e);
          ec.addError(new ErrorItem(INVALID_ATTRIBUTES, e));
          LogLog.error("Ignoring configuration file [" + fileName + "].");
      
        }
      } else if (
        !(Option.isEmpty(name) || Option.isEmpty(value))
          && Option.isEmpty(fileName)) {
        value = OptionConverter.convertSpecialChars(value);
        ec.addProperty(name, value);
      } else {
        LogLog.error(INVALID_ATTRIBUTES);
        ec.addError(new ErrorItem(INVALID_ATTRIBUTES));
      }
    }
  
    public void end(ExecutionContext ec, String name) {
    }
  
    public void finish(ExecutionContext ec) {
    }
  }
  
  
  
  1.2       +1 -1      
logging-log4j/examples/tiny-webapp/Tata/src/java/wombat/InitServlet.java
  
  Index: InitServlet.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/examples/tiny-webapp/Tata/src/java/wombat/InitServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InitServlet.java  30 Mar 2004 10:45:21 -0000      1.1
  +++ InitServlet.java  15 May 2004 18:22:57 -0000      1.2
  @@ -1,7 +1,7 @@
   package wombat;
   
   import org.apache.log4j.*;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   import javax.servlet.http.*;
   import javax.servlet.*;
   
  
  
  
  1.11      +2 -2      logging-log4j/src/java/org/apache/log4j/net/SocketServer.java
  
  Index: SocketServer.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/net/SocketServer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SocketServer.java 24 Apr 2002 01:16:12 -0000      1.10
  +++ SocketServer.java 15 May 2004 18:22:57 -0000      1.11
  @@ -167,7 +167,7 @@
   
         File configFile = new File(dir, key+CONFIG_FILE_EXT);
         if(configFile.exists()) {
  -     Hierarchy h = new Hierarchy(new RootCategory((Level) Priority.DEBUG));
  +     Hierarchy h = new Hierarchy(new RootLogger((Level) Priority.DEBUG));
        hierarchyMap.put(inetAddress, h);
   
        new PropertyConfigurator().doConfigure(configFile.getAbsolutePath(), h);
  @@ -184,7 +184,7 @@
       if(genericHierarchy == null) {
         File f = new File(dir, GENERIC+CONFIG_FILE_EXT);
         if(f.exists()) {
  -     genericHierarchy = new Hierarchy(new RootCategory((Level) Priority.DEBUG));
  +     genericHierarchy = new Hierarchy(new RootLogger((Level) Priority.DEBUG));
        new PropertyConfigurator().doConfigure(f.getAbsolutePath(), genericHierarchy);
         } else {
        cat.warn("Could not find config file ["+f+
  
  
  
  1.7       +4 -0      
logging-log4j/src/java/org/apache/log4j/joran/JoranConfigurator.java
  
  Index: JoranConfigurator.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/joran/JoranConfigurator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JoranConfigurator.java    12 May 2004 20:05:39 -0000      1.6
  +++ JoranConfigurator.java    15 May 2004 18:22:57 -0000      1.7
  @@ -156,4 +156,8 @@
         ec.addError(new ErrorItem("Parser configuration error occured", ie));
       }
     }
  +  
  +  public ExecutionContext getExecutionContext() {
  +    return joranInterpreter.getExecutionContext();
  +  }
   }
  
  
  
  1.14      +4 -4      
logging-log4j/tests/src/java/org/apache/log4j/plugins/PluginTestCase.java
  
  Index: PluginTestCase.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/tests/src/java/org/apache/log4j/plugins/PluginTestCase.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PluginTestCase.java       12 May 2004 15:39:04 -0000      1.13
  +++ PluginTestCase.java       15 May 2004 18:22:57 -0000      1.14
  @@ -27,7 +27,7 @@
   import org.apache.log4j.Logger;
   import org.apache.log4j.SimpleLayout;
   import org.apache.log4j.spi.LoggerRepository;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   import org.apache.log4j.util.Compare;
   
   import java.beans.PropertyChangeEvent;
  @@ -222,8 +222,8 @@
   //        PluginTester plugin1 = new PluginTester1("plugin1", 1);
   //        PluginTester plugin2 = new PluginTester1("plugin2", 2);
   //        PluginTester retPlugin;
  -//        LoggerRepository repo1 = new Hierarchy(new RootCategory(Level.DEBUG));
  -//        LoggerRepository repo2 = new Hierarchy(new RootCategory(Level.DEBUG));
  +//        LoggerRepository repo1 = new Hierarchy(new RootLogger(Level.DEBUG));
  +//        LoggerRepository repo2 = new Hierarchy(new RootLogger(Level.DEBUG));
   //        
   //        PluginRegistry pr1 = repo1.getPluginRegistry();
   //        PluginRegistry pr2 = repo2.getPluginRegistry();
  @@ -438,7 +438,7 @@
           LoggerRepository oldValue = plugin.getLoggerRepository();
           plugin.addPropertyChangeListener("loggerRepository", l);
   
  -        LoggerRepository rep = new Hierarchy(new RootCategory(Level.DEBUG));
  +        LoggerRepository rep = new Hierarchy(new RootLogger(Level.DEBUG));
           plugin.setLoggerRepository(rep);
   
           assertTrue("Should be notified of LoggerRepository property change",
  
  
  
  1.10      +2 -2      
logging-log4j/src/java/org/apache/log4j/selector/ContextJNDISelector.java
  
  Index: ContextJNDISelector.java
  ===================================================================
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/selector/ContextJNDISelector.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ContextJNDISelector.java  12 May 2004 15:39:05 -0000      1.9
  +++ ContextJNDISelector.java  15 May 2004 18:22:57 -0000      1.10
  @@ -25,7 +25,7 @@
   
   import org.apache.log4j.spi.LoggerRepository;
   import org.apache.log4j.spi.RepositorySelector;
  -import org.apache.log4j.spi.RootCategory;
  +import org.apache.log4j.spi.RootLogger;
   
   
   import java.util.Collections;
  @@ -177,7 +177,7 @@
   
         if (hierarchy == null) {
           // create new hierarchy
  -        hierarchy = new Hierarchy(new RootCategory(Level.DEBUG));
  +        hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
           hierarchy.setName(loggingContextName);
           hierMap.put(loggingContextName, hierarchy);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to