[prev in list] [next in list] [prev in thread] [next in thread]
List: log4j-dev
Subject: Re: modifying config file loading code so it can handle custom
From: Ceki =?iso-8859-1?Q?G=FClc=FC?= <cgu () qos ! ch>
Date: 2001-06-27 18:26:39
[Download RAW message or body]
Colin,
Thanks for the info. A slightly different solution is to have \
OptionConverter.selectAndConfigure leave the reference part alone of it contains \
slashes instead of dots. Your patch is most welcome. Ceki
At 17:54 27.06.2001 +0000, Colin Sampaleanu wrote:
> I would like to suggest that the code which is reponsible for the loading of
> a property file (or XML configuration file) be modified somewhat, since
> presently it can not handle custom URL types.
> Right now, the static init method in Category establishes a URL for the
> property file, either from a value explicitly set in a "log4j.configuration"
> system variable, or by asking the classloader to find the the
> "log4j.properties" file. Once it has the URL, it then calls
> OptionConverter.selectAndConfigure(url, defaultHierarchy);
> OptionConverter then takes a look at the URL, and if it has a 'ref' portion,
> assumes that that is the classname of a custom configurator class, and tries
> to instantiate that class to handle the config file.
> The problem with this scheme is that it can't handle URLs in which the 'ref'
> portion is actually relevant to accessing the file.
> If I have a Servlet Web App in a .WAR file and deploy it to WebLogic 6,
> WebLogic will never actually expand out the log4j.properties file that is in
> the /WEB-INF/classes dir inside the .WAR file. It has a custom classloader
> and zip url handler that knows how to load files from within the war file.
> So when the classloader is asked for the URL of log4j.properties, it returns
> something like:
> zip:D:/dev/bea/wlserver6.0/config/mydomain/applications/.wl_temp_do_not_dele
> te/wl_local_comp7017.war#WEB-INF/classes/log4j.properties
> OptionConverter then blows up on this since it assumes there is a custom
> configurator class called 'WEB-INF/classes/log4j.properties', and blows up
> when it can't load it.
> It would be pretty simple to fix this, by checking the URL returned from the
> classloader, and if it has a 'ref' section, then calling OptionConverter
> with an option saying to not treat the 'ref' as a configurator class.
> If people are in agreement with this, I am willing to make changes and post
> them as patches...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
--
Ceki Gülcü
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic