logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Configuration methods
Date Fri, 09 May 2003 18:57:41 GMT

Howdy,
Is your case such that you can get an InputStream but can't get a URL to
the source?  The configurator already supports a configure with URL
argument, which should be general enough for nearly everything:
class.getResource(...), servletContext.getResource(...), JNDI lookups,
etc.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: RBair@dtint.com [mailto:RBair@dtint.com]
>Sent: Friday, May 09, 2003 2:49 PM
>To: log4j-dev@jakarta.apache.org
>Subject: 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



This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


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


Mime
View raw message