File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes use of commons-logging under was 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "use of commons-logging under was 5.0" Watch "use of commons-logging under was 5.0" New topic

use of commons-logging under was 5.0

Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
I try to use commons-logging inside my application to generate custom log files. As far as I see, WAS 5.0 use commons-logging for his own logging and register a custom LogFactory in the ws-commons-logging.jar.
How is it possible to change the factory to Log4J without changing the WAS logging? I try it on my own, but there are serveral problems with starting websphere, after changing the factory.
Thank you
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
I believe Benoit solved that problem in this thread.
Please let us know if that fixes your problem.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
Thank you Kyle.
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
Integrating Jakarta Commons Logging with IBM WebSphere Application Server V5
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
Kyle et. al:
Thanks for the information on the logging solution, but it doesn't work.
Per the referenced document:
"Caviat: this solution is sensitive to changes regarding WebSphere's employment of the file to integrate the TrLog feature. If future versions of WebSphere utilize the ´┐ŻLogFactory file to specify the TrLogFactory implementation, this solution will be ineffectual unless PARENT_LAST classloader delegation is also employed. The following sections discuss the warrant for using PARENT_LAST classloader delegation. "
The key is this: WAS v5 ALREADY uses the file to integrate the TrLog feature! I tried both the EAR and WAR solutions provided/recommended and neither worked without the PARENT_LAST setting.
To see for yourself, pop open AppServer/lib/ws-commons-logging.jar and peek at the content of It points to the TrLogFactory. Because this is on the core server classpath, it cannot be overridden without a file before it on the classpath, which is impossible to do without the PARENT_LAST setting.

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The team, Newsletter 039.
I agree. Here's the link:
subject: use of commons-logging under was 5.0
It's not a secret anymore!