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 mw...@apache.org on 2004/12/09 06:22:59 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j PropertyConfigurator.java

mwomack     2004/12/08 21:22:59

  Modified:    src/java/org/apache/log4j PropertyConfigurator.java
  Log:
  Updating to impelement new doConfigure(InputStream, LoggingRepository) method required by updated Configurator interface.
  
  Revision  Changes    Path
  1.72      +25 -0     logging-log4j/src/java/org/apache/log4j/PropertyConfigurator.java
  
  Index: PropertyConfigurator.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/PropertyConfigurator.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- PropertyConfigurator.java	20 Nov 2004 11:27:19 -0000	1.71
  +++ PropertyConfigurator.java	9 Dec 2004 05:22:59 -0000	1.72
  @@ -419,6 +419,31 @@
   
       doConfigure(props, repository);
     }
  +  
  +  /**
  +   * Read configuration options from input stream <code>configStream</code>.
  +   * @since 1.3
  +   * @param configStream
  +   * @param repository
  +   */
  +  public void doConfigure(InputStream configStream,
  +  LoggerRepository repository) {
  +    Properties props = new Properties();
  +    getLogger(repository).debug(
  +      "Reading configuration from input stream");
  +
  +    try {
  +      props.load(configStream);
  +    } catch (java.io.IOException e) {
  +      String errMsg =
  +        "Could not read configuration file from input stream.";
  +      addError(new ErrorItem(errMsg, e));
  +      getLogger(repository).error(errMsg, e);
  +      return;
  +    }
  +
  +    doConfigure(props, repository);
  +  }
   
     // --------------------------------------------------------------------------
     // Internal stuff
  
  
  

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