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/selector ContextJNDISelector.java
Date Tue, 30 Nov 2004 00:03:03 GMT
ceki        2004/11/29 16:03:03

  Modified:    src/java/org/apache/log4j/selector ContextJNDISelector.java
  Log:
  For non-default repositories we do not try to search for default
  config files such as log4j.xml or log4j.properties because
  we have no deterministic way of finding the right one
  
  Revision  Changes    Path
  1.13      +8 -21     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ContextJNDISelector.java	29 Nov 2004 01:59:25 -0000	1.12
  +++ ContextJNDISelector.java	30 Nov 2004 00:03:03 -0000	1.13
  @@ -21,7 +21,6 @@
   import org.apache.log4j.helpers.Constants;
   import org.apache.log4j.helpers.IntializationUtil;
   import org.apache.log4j.helpers.JNDIUtil;
  -import org.apache.log4j.helpers.Loader;
   
   import org.apache.log4j.spi.LoggerRepository;
   import org.apache.log4j.spi.RepositorySelector;
  @@ -187,27 +186,15 @@
           // Check if Mrs. Piggy gave us explicit configration directives
           // regarding this directory.
           String configResourceStr = JNDIUtil.lookup(ctx, JNDI_CONFIGURATION_RESOURCE);
  -        String configuratorClassName = JNDIUtil.lookup(ctx, JNDI_CONFIGURATOR_CLASS);
  -
  -        // If no explicit direction were given, then user automatic 
  -        // the default configuration files. Try log4j.xml first and then
  -        // log4j.properties.
  -        // Note that Loader.getResource() method uses the Thread Context
  -        // Classloader first and if that fails,tries "other" classloaders, 
  -        // including the System classloader. This is actually quite wrong as
  -        // only the TCL should be tried.
  -        if (configResourceStr == null) {
  -          if (
  -            Loader.getResource(Constants.DEFAULT_XML_CONFIGURATION_FILE) != null) {
  -            configResourceStr = Constants.DEFAULT_XML_CONFIGURATION_FILE;
  -          } else if (
  -            Loader.getResource(Constants.DEFAULT_CONFIGURATION_FILE) != null) {
  -            configResourceStr = Constants.DEFAULT_CONFIGURATION_FILE;
  -          }
  +        
  +        // For non-default repositories we do not try to search for default
  +        // config files such as log4j.xml or log4j.properties because
  +        // we have no deterministic way of finding the right one
  +        if(configResourceStr != null) {
  +          String configuratorClassName = JNDIUtil.lookup(ctx, JNDI_CONFIGURATOR_CLASS);
  +          IntializationUtil.initialConfiguration(
  +           hierarchy, configResourceStr, configuratorClassName);
           }
  -
  -        IntializationUtil.initialConfiguration(
  -          hierarchy, configResourceStr, configuratorClassName);
         }
   
         return hierarchy;
  
  
  

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