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:24 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://")) {

        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,

Jukka Zitting <jukka.zitting@gmail.com> wrote: Hi,

On 2/8/07, Stefan Guggisberg  wrote:
> On 2/7/07, Jukka Zitting  wrote:
> > Sounds reasonable, but I'm not convinced that the performance gain is
> > noticeable enough to justify the change. What's the access pattern
> > we're trying to speed up?
> well, applications that make *heavy* use of  Node.getNodeByUUID do
> benefit considerably as shown by our profiling data.

My assumption is that the isNodeType() call should be pretty fast
since the NodeState with the type information has already been loaded.
Perhaps there's a performance issue with the EffectiveNodeType

I would assume that an application that uses getNodeByUUID() will also
do something with the returned Node. This change obviously speeds up
the getNodeByUUID() method call especially if the NodeState is already
cached, but is the speedup big enough to have a noticeable effect on
any composite operation? Intuitively I'd assume isNodeType() to be
faster than things like getNode() or getProperty(). If this assumption
is true, then removing the call would only have a marginal effect on
the overall performance.


Jukka Zitting

Don't get soaked.  Take a quick peak at the forecast 
 with theYahoo! Search weather shortcut.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message