Hello all
We've got a problem. We use dfc.jar in Websphere App-Servers. All App-Server in our enterprise have a java system propertie called "log4j.configuration" and this is always configured with the value "log4j_d.configuration" or "log4j_x.configuration". It depends on the environement.
Now - the class LoggingConfigurator is not our friend. I decompiled it and i see how the log4.configuration will be loaded. Now the LoggingConfiguration creates an absolute path to the log4j.propertie file - but it is the wrong path > %JVM_DIRECTORY%\log4j.properties.
I can't change the value of log4j.configuraton - because all enterprise application use that. Why doesn't load the LoggingConfigurator the file not about the Classpath!!!!!???? Is there an way to configure the LoggingConfiguratior in the behavior how it loads the property?
Thank you
Geronimo
LoggingConfiguration -> findlog4jconfig();
private static URL findLog4jConfiguration()
{
URL url = null;
String configuration = System.getProperty("log4j.configuration");
if (configuration != null)
{
try
{
url = new URL(configuration);
}
catch (MalformedURLException ex)
{
try
{
url = new File(configuration).toURI().toURL(); -> this case will be use, but its wrong!!!
}
catch (MalformedURLException e)
{
url = getResource(configuration);
if (url == null) {
System.out.println("Configuration '" + configuration + "' given by log4j.configuration was not found");
}
}
}
}
if (url == null)
url = getResource("log4j.xml");
if (url == null) {
url = getResource("log4j.properties");
}
if ((url != null) && (isDiagnosingConfig())) {
System.out.println("Reading log4j configuration from \"" + UrlUtil.decode(url.toString()) + "\"");
}
return url;
}