ceki        01/09/25 02:05:56

  Modified:    .        build.sh
               docs     HISTORY
               src/java/org/apache/log4j PropertyConfigurator.java
               src/java/org/apache/log4j/test propConfig shallow
  Added:       build/lib jmxri.jar
  Log:
  - Added jmxri.jar.
  
  - Modified PropertyConfigurator to take a loggerFactory instead of categoryFactory 
prefix.
  
  Revision  Changes    Path
  1.3       +5 -6      jakarta-log4j/build.sh
  
  Index: build.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/build.sh,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.sh  2001/09/10 22:31:16     1.2
  +++ build.sh  2001/09/25 09:05:56     1.3
  @@ -19,13 +19,12 @@
      CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
   fi
   
  -ANT_JAR='build/lib/ant.jar'
  -JAXP_JAR='build/lib/jaxp-1.1.jar'
  -PARSER_JAR='build/lib/crimson-1.1.jar'
  +for l in build/lib/*.jar 
  +do
  +echo L=$l
  +CLASSPATH=${CLASSPATH}:$l
  +done
   
  -CLASSPATH=${CLASSPATH}:${ANT_JAR}
  -CLASSPATH=${CLASSPATH}:${JAXP_JAR}
  -CLASSPATH=${CLASSPATH}:${PARSER_JAR}
   
   # convert the unix path to windows
   if [ "$OSTYPE" = "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
  
  
  
  1.1                  jakarta-log4j/build/lib/jmxri.jar
  
        <<Binary file>>
  
  
  1.65      +7 -5      jakarta-log4j/docs/HISTORY
  
  Index: HISTORY
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/docs/HISTORY,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- HISTORY   2001/09/24 22:43:04     1.64
  +++ HISTORY   2001/09/25 09:05:56     1.65
  @@ -5,12 +5,14 @@
          client code. 
    [***] Changes requiring important modifications to existing client code.
   
  - ??, 2001
  + September 25, 2001
   
    - Release of version 1.2alpha_0
   
  + - Log4j is now configurable using JMX. [*]
  +
    - Modified SMTPAppender to allow multiple email sessions. Thanks to
  -   Jon Skeet for supplying the relevant patch.
  +   Jon Skeet for supplying the relevant patch. [*]
   
    - The CategoryFactory class has been replaced by the LoggerFactory
      class. The makeNewCategoryInstance method has been renamed as
  @@ -41,7 +43,7 @@
    - Introduced the Mapped Diagnostic Context or MDC class. This class
      is similar to the NDC except that the diagnistic context is based
      on a map instead of a stack. Moreover the MDC is automatically
  -   inherited by child threads under JDK 1.2 and above.
  +   inherited by child threads under JDK 1.2 and above. [*]
   
    - Corrected a performance bug in the NDC class as observed by Dan
      Milstein and independently by Ray Millard. [*]
  @@ -51,9 +53,9 @@
      is implemented by most log4j appenders and layouts. In particular,
      all appenders and layouts shipped with log4j contain these
      deprecated methods. They have become totally redundant after we
  -   moved to JavaBeans style configuration in log4j 1.1.
  +   moved to JavaBeans style configuration in log4j 1.1. [**]
   
  - - Remoced deprecated method disable(Priority), disableAll,
  + - Removed deprecated methods disable(Priority), disableAll,
      disableDebug, disableInfo and enableAll in BasicConfigurator. [*]
   
    - Added supports java.io.Reader objects in the method doConfigure(),
  
  
  
  1.39      +26 -21    
jakarta-log4j/src/java/org/apache/log4j/PropertyConfigurator.java
  
  Index: PropertyConfigurator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/PropertyConfigurator.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- PropertyConfigurator.java 2001/09/25 08:48:45     1.38
  +++ PropertyConfigurator.java 2001/09/25 09:05:56     1.39
  @@ -45,11 +45,11 @@
      files. You can enable log4j internal logging by defining the
      <b>log4j.debug</b> variable.
   
  -   <P>As of log4j version 0.8.5, at the initialization of the Category
  -   class, the file <b>log4j.properties</b> will be searched from the
  -   search path used to load classes. If the file can be found, then it
  -   will be fed to the {@link
  -   PropertyConfigurator#configure(java.net.URL)} method.
  +   <P>As of log4j version 0.8.5, at class initialization time class,
  +   the file <b>log4j.properties</b> will be searched from the search
  +   path used to load classes. If the file can be found, then it will
  +   be fed to the {@link PropertyConfigurator#configure(java.net.URL)}
  +   method.
   
      <p>The <code>PropertyConfigurator</code> does not handle the
      advanced configuration features supported by the {@link
  @@ -75,8 +75,6 @@
      configuration file being parsed.  The corresponding value replaces
      the ${variableName} sequence.
   
  -
  -
      @author Ceki G&uuml;lc&uuml;
      @author Anders Kristensen
      @since 0.8.1 */
  @@ -87,20 +85,21 @@
        Used internally to keep track of configured appenders.
      */
     protected Hashtable registry = new Hashtable(11);
  -  protected LoggerFactory categoryFactory = new DefaultCategoryFactory();
  +  protected LoggerFactory loggerFactory = new DefaultCategoryFactory();
     
     static final String      CATEGORY_PREFIX = "log4j.category.";
     static final String      LOGGER_PREFIX   = "log4j.logger.";
     static final String       FACTORY_PREFIX = "log4j.factory";
     static final String    ADDITIVITY_PREFIX = "log4j.additivity.";
     static final String ROOT_CATEGORY_PREFIX = "log4j.rootCategory";
  +  static final String ROOT_LOGGER_PREFIX   = "log4j.rootLogger";
     static final String      APPENDER_PREFIX = "log4j.appender.";  
     static final String      RENDERER_PREFIX = "log4j.renderer.";
   
     /** Key for specifying the {@link org.apache.log4j.spi.LoggerFactory
         LoggerFactory}.  Currently set to 
         "<code>log4j.categoryFactory</code>".  */
  -  public static final String CATEGORY_FACTORY_KEY = "log4j.categoryFactory";
  +  public static final String LOGGER_FACTORY_KEY = "log4j.loggerFactory";
   
     static final private String INTERNAL_ROOT_NAME = "root";
     
  @@ -413,7 +412,7 @@
       
       
       configureRootCategory(properties, hierarchy);
  -    configureCategoryFactory(properties);
  +    configureLoggerFactory(properties);
       parseCatsAndRenderers(properties, hierarchy);
   
       LogLog.debug("Finished configuring.");    
  @@ -449,23 +448,23 @@
     /**
        Check the provided <code>Properties</code> object for a
        {@link org.apache.log4j.spi.LoggerFactory LoggerFactory}
  -     entry specified by {@link #CATEGORY_FACTORY_KEY}.  If such an entry
  +     entry specified by {@link #LOGGER_FACTORY_KEY}.  If such an entry
        exists, an attempt is made to create an instance using the default
        constructor.  This instance is used for subsequent Category creations
        within this configurator.
   
        @see #parseCatsAndRenderers
      */
  -  protected void configureCategoryFactory(Properties props) {
  -    String factoryClassName = OptionConverter.findAndSubst(CATEGORY_FACTORY_KEY,
  +  protected void configureLoggerFactory(Properties props) {
  +    String factoryClassName = OptionConverter.findAndSubst(LOGGER_FACTORY_KEY,
                                                           props);    
       if(factoryClassName != null) {
         LogLog.debug("Setting category factory to ["+factoryClassName+"].");
  -      categoryFactory = (LoggerFactory) 
  +      loggerFactory = (LoggerFactory) 
                     OptionConverter.instantiateByClassName(factoryClassName,
                                                         LoggerFactory.class, 
  -                                                      categoryFactory);
  -      PropertySetter.setProperties(categoryFactory, props, FACTORY_PREFIX + ".");
  +                                                      loggerFactory);
  +      PropertySetter.setProperties(loggerFactory, props, FACTORY_PREFIX + ".");
       }
     }
   
  @@ -493,14 +492,20 @@
     
       
     void configureRootCategory(Properties props, LoggerRepository hierarchy) {
  -    String value = OptionConverter.findAndSubst(ROOT_CATEGORY_PREFIX, props);
  +    String effectiveFrefix = ROOT_LOGGER_PREFIX;
  +    String value = OptionConverter.findAndSubst(ROOT_LOGGER_PREFIX, props);
  +    
  +    if(value == null) {
  +      value = OptionConverter.findAndSubst(ROOT_CATEGORY_PREFIX, props);
  +      effectiveFrefix = ROOT_CATEGORY_PREFIX;
  +    }
  +
       if(value == null) 
  -      LogLog.debug("Could not find root category information. Is this OK?");
  +      LogLog.debug("Could not find root logger information. Is this OK?");
       else {
         Logger root = hierarchy.getRootLogger();
         synchronized(root) {
  -     parseCategory(props, root, ROOT_CATEGORY_PREFIX, INTERNAL_ROOT_NAME, 
  -                   value);
  +     parseCategory(props, root, effectiveFrefix, INTERNAL_ROOT_NAME, value);
         }
       }        
     }
  @@ -522,7 +527,7 @@
          loggerName = key.substring(LOGGER_PREFIX.length());
        }
        String value =  OptionConverter.findAndSubst(key, props);
  -     Logger logger = hierarchy.getLogger(loggerName, categoryFactory);
  +     Logger logger = hierarchy.getLogger(loggerName, loggerFactory);
        synchronized(logger) {
          parseCategory(props, logger, key, loggerName, value);
          parseAdditivityForLogger(props, logger, loggerName);
  
  
  
  1.5       +1 -1      jakarta-log4j/src/java/org/apache/log4j/test/propConfig
  
  Index: propConfig
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/test/propConfig,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- propConfig        2001/08/09 20:16:31     1.4
  +++ propConfig        2001/09/25 09:05:56     1.5
  @@ -29,7 +29,7 @@
   
   function createProperties {
     echo "" > $LCF
  -  lecho "log4j.rootCategory=DEBUG, A1"
  +  lecho "log4j.rootLogger=DEBUG, A1"
     lecho "log4j.appender.A1=org.apache.log4j.FileAppender"
     lecho "log4j.appender.A1.File=$TEMP"
     lecho "log4j.appender.A1.Append=false"
  
  
  
  1.8       +3 -3      jakarta-log4j/src/java/org/apache/log4j/test/shallow
  
  Index: shallow
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/test/shallow,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- shallow   2001/05/25 19:39:07     1.7
  +++ shallow   2001/09/25 09:05:56     1.8
  @@ -55,7 +55,7 @@
    echo "$A2_PREFIX.File=$logFile.A2" >> $LCF   
   
    echo "$ROOT_PREFIX=$rootPriority, A1" >> $LCF
  - echo "log4j.category.org.apache.log4j.test.Shallow=$shallowPriority, A2" >> $LCF 
  + echo "log4j.logger.org.apache.log4j.test.Shallow=$shallowPriority, A2" >> $LCF 
   
    if [ -n "$additivity" ]; then
      echo "log4j.additivity.org.apache.log4j.test.Shallow=$additivity" >> $LCF
  @@ -151,11 +151,11 @@
     echo "log4j.appender.A.Append=false" >> socket.lcf
     echo "log4j.appender.A.layout=org.apache.log4j.PatternLayout" >> socket.lcf
     echo "log4j.appender.A.layout.ConversionPattern=%5p %x [%t] %c %m%n" >> socket.lcf
  -  echo "log4j.configDebug=true" >> socket.lcf
  +  echo "log4j.debug=true" >> socket.lcf
      
     java org.apache.log4j.test.ShortSocketServer $PORT socket.lcf  &
     sleep 3     
  -  echo "log4j.rootCategory=DEBUG, A" > $LCF
  +  echo "log4j.rootLogger=DEBUG, A" > $LCF
     lecho "log4j.appender.A=org.apache.log4j.net.SocketAppender"
     lecho "log4j.appender.A.Port=$PORT"
     lecho "log4j.appender.A.RemoteHost=localhost"
  
  
  

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

Reply via email to