Re: [Webwork-devel] loading log4j.properties
Brought to you by:
baldree,
rickardoberg
|
From: Rickard <ri...@mi...> - 2002-01-08 08:18:02
|
Matt Baldree wrote:
> I was working on the JSP documentation and realized we need a configuration
> document to describe how to configure WW. I wrote this today and added it to
> CVS. One section in configuration talks about configuring WW's logger. I
> think the developer should be able to substitute the default
> log4j.properties under webwork/ with their own if they so choose. This means
> they could provide a log4j.properties under WEB-INF/classes that WW would
> first check before loading its default under webwork/. This allows the
> developer a clean log4j.properties substitution without having to
> programmatically do it somewhere else. To allow this capability, I propose
> changing the ServletDispatcher as follows:
>
> 84c84,92
> <
> PropertyConfigurator.configure(classLoader.getResource("webwork/log4j.proper
> ties"));
> ---
>
>> try
>> {
>>
>>
> PropertyConfigurator.configure(classLoader.getResource("log4j.properties"));
>
>> log.info("Custom log4j property file loaded.");
>> } catch (Exception e)
>> {
>>
>>
> PropertyConfigurator.configure(classLoader.getResource("webwork/log4j.proper
> ties"));
>
>> log.info("Default log4j property file loaded.");
>> }
>>
>
> Thoughts?
This sounds like a good first step, then accompanied with what Mike
proposed.
/Rickard
--
Rickard Öberg
|