logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carson, Chuck" <Chuck.Car...@syrrx.com>
Subject Log4j: Using servlet to init, but how to reload???
Date Wed, 23 Oct 2002 21:00:33 GMT

I am using a servlet to intialize log4j as so:

public class Log4jInit extends HttpServlet
{
    public void init()
    {
      String prefix_dir   = getServletContext().getRealPath("/");
      String param_file   = getInitParameter("log4j-init-file");
      PropertyConfigurator.configure(prefix_dir + param_file);
    }

    public void doGet(HttpServletRequest req, HttpServletResponse res)
    {
    }
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    {
    }
}

I have this in ROOT/WEB-INF/web.xml:
    <servlet>
                <servlet-name>Log4jInit</servlet-name>
                <servlet-class>Log4jInit</servlet-class>
                <init-param>
                    <param-name>log4j-init-file</param-name>
                    <param-value>WEB-INF/log4j.config</param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
    </servlet>

This works fine, however, any changes made to log4j.config do not take effect until the server
is restarted. Is the something I can code or something I can configure to change this?

Much thanks,
Chuck


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message