4 messages in org.apache.logging.log4j-userProperty Configurator
FromSent OnAttachments
Viv KapJun 11, 2004 3:40 pm 
Donald LarmeeJun 13, 2004 7:01 pm 
Viv KapJun 13, 2004 9:43 pm 
Donald LarmeeJun 14, 2004 5:45 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Property ConfiguratorActions...
From:Viv Kap (vivk@yahoo.com)
Date:Jun 11, 2004 3:40:07 pm
List:org.apache.logging.log4j-user

Hi I have a J2EE application and we use log4j for logging. We used log4j.properties files and packaged it in a war under WEB-INF/classes. It all worked fine under Weblogic, Tomcat etc. But now when we migrated to JBoss it has its own log4j.xml file. So our application grabbed it as the first one and did not load our log4j.properties. I got around it by using -Dlog4j.configuration=log4j.properties in the startup command. But I really dont like this soultion because this system property will now be applicabe to all applications on JBOSS and thats not a good thing. Now we are plannning to use our own name like log4j-productName.properties file and make use of PropertyConfigurator. From the startup command we will pass the directory name containg config files : example -Dproduct.config=c:/config . In this we will have the log4j-product.properties file. And we will load it and use PropertyConfigurator. But this is not working exactly. When we start the server it gives all sort of exception. where should I exactly use the PropertyConfigurator ? In a static block ? This is what I have

String path = System.getProperty("config.home"); Properties p = new Properties(); try { FileInputStream fis = new FileInputStream(path + "/log4j-product.properties"); p.load(fis); } catch (FileNotFoundException e) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. } catch(java.io.IOException ie) { ie.printStackTrace(); }

PropertyConfigurator.configure(p);

I get this error: 04-06-11 15:32:53,924 INFO [STDOUT] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@12b6651]. 2004-06-11 15:32:53,924 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url null 2004-06-11 15:32:53,924 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] setRepository, r=org.jboss.mx.loading.HeirarchicalLoaderRepository3@cee271, ucl=org.jboss.mx.loading.UnifiedClassLoader3@d9ceea{ url=null ,addedOrder=0} 2004-06-11 15:32:53,924 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url null 2004-06-11 15:32:53,924 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] setRepository, r=org