This content has been marked as final.
Show 2 replies
-
1. Re: JBoss JTA and the logging system: using system propertie
jhalliday Jan 15, 2009 7:02 AM (in response to mauromol)This is basically JBTM-325 and stems from commons logging braindead use of what are essentially global variables. Have you tried bundling commons logging with the app, which should cause it to be loaded from the webapp classloader rather than tomcat and thus have its own local config?
-
2. Re: JBoss JTA and the logging system: using system propertie
mauromol Jan 15, 2009 11:21 AM (in response to mauromol)"jhalliday" wrote:
This is basically JBTM-325 and stems from commons logging braindead use of what are essentially global variables. Have you tried bundling commons logging with the app, which should cause it to be loaded from the webapp classloader rather than tomcat and thus have its own local config?
Commons logging is bundled with my app, but not with the other apps (like ROOT) that fail to start.
After new tests I see that I must deploy both commons-logging and log4j to Tomcat common lib, but in this way I need to configure log4j for the whole Tomcat to avoid to loose log messages because of a "log4j not configured problem".
At the end, the workaround I did is the following:final String logSystemPropertyValue = System.getProperty(LogFactoryImpl.LOG_PROPERTY, null); jdbcLogger.logger.isDebugEnabled(); if(logSystemPropertyValue == null) System.clearProperty(LogFactoryImpl.LOG_PROPERTY); else System.setProperty(LogFactoryImpl.LOG_PROPERTY, logSystemPropertyValue);
This code is expecuted early in my webapp initialization. In this way, subsequent use of the jdbcLogger.logger does not cause the system property to be set and other apps can start after mine with no problem.
I know it's ugly...
Mauro.