|
From: Ben A. <ben...@ac...> - 2004-05-14 01:16:52
|
Hi everyone
I was just wondering why Log4jWebConfigurer includes the
WebUtils.setWebAppRootSystemProperty(servletContext) line. AFAIK, it enables
properties such as ${webapp.root} to be used in log4j.properties. However,
as the JavaDocs explain, it conflicts in some containers (in my case Jetty)
unless an explicit "webAppRootKey" is specified for each webapp in web.xml.
This is a bit of a problem for those of us trying to deploy multiple web
applications in the same container for different clients, as we'd need to
generate a different web.xml for each (just to set the webAppRootKey to
something unique). I've spent a lot of time writing adapters and other
classes so client-specific properties can be held in the application context
and configured via PropertyPlaceholderConfigurer. It would therefore be
unfortunate to have to generate client-specific web.xml files, simply to set
a unique webAppRootKey.
To overcome the above, I've copied Log4jWebConfigurer and
Log4jConfigListener into a new package, simply commenting out the
WebUtils.setWebAppRootSystemProperty line. It seems to work, as I don't use
${webapp.root} in log4j.properties. I was therefore wondering if anyone has
any concerns with me providing a patch that skips over the
WebUtils.setWebAppRootSystemProperty if Log4jConfigListener detects an
initialization parameter named "log4jDoNotCreateWebAppRootSystemProperty"?
Cheers
Ben
|