Hi

Log4j 1.2.7 can load log4.xml from your classpath

Or you can use jakarta commons-logging, which will load your log4j.xml
automaticaly too

Dom

----- Original Message -----
From: "Gemes Tibor" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 1:13 PM
Subject: Re: AW: loading configuration on startup


2003. janu�r 22. 12:59 d�tummal Softwareentwicklung Hauschel ezt �rtad:
> But my log4j.properties are a log4j.xml file.
> That doesn't work in classpath ;-(
> In addition there are mor configurations i need for the whole applikation.

I can't see why can you not pick up the init-params in your serlvet's init()
method. It's so easy.
For each servlet I wrote I provide the config parameter which is an xml
file.
This xml is parsed with Digester.
This is how I do it, and do not be surprised if you see some coincidence
with
the ActionServlet's init() method...

    public void init() throws ServletException {
        String value;

        try {
            LOG.debug("start init");
            // Initialize the context-relative path to our configuration
resources
            value = getServletConfig().getInitParameter("config");
            if (value != null)
                config = value;
            // Acquire an input stream to our configuration resource
            InputStream input =
getServletContext().getResourceAsStream(config);
            if (input == null)
                throw new UnavailableException
                ("config file '" + config + "' is missing");

            Digester digester = null;
            digester = initDigester();
...


Hth,

Tib

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





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

Reply via email to