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 RB...@dtint.com on 2003/05/09 20:49:27 UTC

Configuration methods

Ceki/Mark & Co.,

I added a new doConfigure method to PropertyConfigurator.  While it is 
true that I could easily enough create the Properties object and pass it 
in to the appropriate doConfigure method, this would be a nice convenience 
method and DOMConfigurator has a doConfigure method using inputstream.

  /**
         Read configuration options from an input stream <code>in</code>.
   */
  public void doConfigure(InputStream in, LoggerRepository hierarchy) {
        Properties props = new Properties();
        LogLog.debug("Reading configuration from stream " + in);

        try {
          props.load(in);
        } catch (java.io.IOException e) {
          LogLog.error(
                "Could not read configuration from stream [" + in + "].", 
e);
          LogLog.error("Ignoring configuration stream [" + in + "].");

          return;
        }

        doConfigure(props, hierarchy);
  }


Richard