[Webwork-devel] Configuring Logging
Brought to you by:
baldree,
rickardoberg
|
From: Mike Cannon-B. <mi...@at...> - 2001-11-26 01:10:19
|
Guys,
I've written a minor patch to allow users to configure logging
themselves.
Basically instead of :
PropertyConfigurator.configure(classLoader.getResource("webwork/log4j.properties"));
in ServletDispatcher - allow the user to set two init parameters
(mutually exclusive) - log4j-xml-config and log4j-properties-config
if (config.getInitParameter("log4j-xml-config") != null)
DOMConfigurator.configure(classLoader.getResource(config.getInitParameter("log4j-xml-config"));
else if (config.getInitParameter("log4j-properties-config") != null)
PropertyConfigurator.configure(classLoader.getResource(config.getInitParameter("log4j-properties-config"));
else
PropertyConfigurator.configure(classLoader.getResource("webwork/log4j.properties"));
This allows for more flexibility (optionitis!) without making it any
more complex if you want it simple - sticking with the WW philosophy of
having a default config that suits most users, but configurable if
needed.
Alternatively there could be a LoggingServletDispatcher (subclass of the
original), or potentially just split the log4j configuration into it's
own method which can be overridden to allow you to do configureAndWatch
etc.
thoughts?
Mike
--
Mike Cannon-Brookes :: mi...@at...
Atlassian :: http://www.atlassian.com
Supporting YOUR J2EE World
|