jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tushar Vijay Apshankar <tushar2...@yahoo.com>
Subject Configuring log4j from a URL
Date Thu, 08 Feb 2007 11:04:52 GMT
Hi Developers,
We are using JackRabbit in one of our project.
We need to specify the logging configuration dynamically through a URL.
Currently JackRabbit does not support it. We looked into the LoggingServlet.java and want
to modify the configure() method in following way(please see the highlighted code below) so
that it starts supporting URL as well:

private void configure() throws ServletException {
 // setup log4j
 String log4jConfig = getServletConfig().getInitParameter(INIT_PARAM_LOG4J_CONFIG);

if (log4jConfig.startsWith("http://")) {
            configureURL(log4jConfig);
            return;
        }

        InputStream in = getServletContext().getResourceAsStream(log4jConfig);
......
......
......
}
    /**
     * Configures the log4j from a URL using the {@link DOMConfigurator}
     * @param urlString
     * @throws ServletException
     */
    private void configureURL(String urlString) throws ServletException {
        try {
            DOMConfigurator.configure(new URL(urlString));
        } catch (MalformedURLException e) {
            throw new ServletException("Invalid URL: " + e.toString());
        }
    }

Can you advice how can we get this code checked in into the code-base?

Thanks and regards,
Tushar



 
---------------------------------
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message