File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Soft Skills this week in the Jobs Discussion 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
Author

use of commons-logging under was 5.0

Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
Hi,
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
author
Ranch Hand

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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ 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
http://www-1.ibm.com/support/docview.wss?uid=swg27004610
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 commons-logging.properties 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 commons-logging.properties 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 commons-logging.properties. 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.
--David


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use of commons-logging under was 5.0