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 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.
This will take every ounce of my mental strength! All for a tiny ad: