Hi Boris, Thanks for those links. I have already read them but they do not outline a full solution. Their suggestion is to provide a file named org.apache.commons.logging.LogFactory, located in the META-INF/services directory, that contains the name of the factory class on the first line i.e. org.apache.commons.logging.impl.LogFactoryImpl.
But when LogFactoryImpl is trying to get a log implementation the first thing it looks for is a property "org.apache.commons.logging.Log". WebSphere 6 provides this property with a value set to Jdk14Logger (WebSphere 5 doesn't do this). Therefore, JCL creates an instance of Jdk14Logger and doesn't attempt to discover log4j on the classpath. It appears that WebSphere's commons-logging.properties will always be loaded before an application's file, because Classloader.getResources(String name) will search the parent classloader first and that is how JCL loads the properties files. Looks to me like the app has to supply a commons-logging.properties with a priority > 0.0 to use JCL 1.1 with log4j running on WebSphere 6. For previous versions of JCL, I think you have to use a custom log factory implementation class other than LogFactoryImpl or else use the deprecated Log4jFactory (which doesn't sound appealing). Regards, Seamus -----Original Message----- From: Boris Unckel [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 3:56 PM To: Jakarta Commons Users List Subject: Re: [commons-logging] JCL with log4j on WebSphere 6 Hello Seamus, -------- Original-Nachricht -------- Datum: Tue, 26 Sep 2006 10:30:43 -0400 Von: "Kerrigan, Seamus" <[EMAIL PROTECTED]> An: [email protected] Betreff: [commons-logging] JCL with log4j on WebSphere 6 > Hi, > > I am trying to use JCL 1.1 with log4j in an application which is > deployed on WebSphere 6.0.2. I found that the documentation for running > JCL on WebSphere, only works on WebSphere 5 and not 6. I found a documentation for 6.0.x on http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp I searched for "commons logging": Overview: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/c om.ibm.websphere.nd.doc/info/ae/ae/ctrb_classload_jcl.html Configuration http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/c om.ibm.websphere.nd.doc/info/ae/ae/ttrb_classload_jcl.html The configuration document contains: >Best practice: The default configuration of Jakarta Commons Logging is > stored in the commons-logging.properties file. To specify the factory > class to use with Jakarta Commons Logging in an application, provide a > file named org.apache.commons.logging.LogFactory, located in > META-INF/services directory, that contains the name of the factory class > on the first line. This is the configuration mechanism for the JAR file > service provider, as defined in JDK 1.3 and above. Since we just use the java.util.logging.Logger for our WebSphere Applications directly sometimes a homegrown wrapper I did not have the task to get it differently running. Regards Boris --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
