Thanks for the update Simon. The priority flag is a nice addition to JCL
1.1 and the diagnostic output was extremely useful in tracking down this
particular issue.

I will definitely add the info to the wiki regarding WebSphere 6.

I'm actually discussing this issue with IBM at the moment. If any other
(better) workarounds come out of those discussions I will pass along the
information.

Thanks,
Seamus 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 27, 2006 7:13 PM
To: Jakarta Commons Users List
Cc: Kerrigan, Seamus
Subject: RE: [commons-logging] JCL with log4j on WebSphere 6


Hi Seamus,

The reason the priority approach isn't mentioned in wiki docs etc is
that the priority config option was only added in the most recent
release. It's great that it happens to solve this problem for you, and
in fact it was intended to handle this sort of situation. If you could
add this info about websphere6 to the logging wiki that would be
appreciated.

The log4jFactory class has been deprecated for a very long time
(commons-logging is now a very old project!). I don't personally know
why it was deprecated, but presume it was because in general it isn't
needed as the standard factory class is configurable. Obviously it's bad
to keep maintaining two classes that do the same job - except that
having a separate factory *does* solve a specific issue with WebSphere 6
(and only for log4j too..).

Regards,

Simon

---- "Kerrigan wrote: 
> 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]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to