[hornetq-commits] JBoss hornetq SVN: r8063 - trunk/src/main/org/hornetq/core/logging.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Oct 7 07:22:12 EDT 2009


Author: jmesnil
Date: 2009-10-07 07:22:11 -0400 (Wed, 07 Oct 2009)
New Revision: 8063

Modified:
   trunk/src/main/org/hornetq/core/logging/Logger.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-167: Refactor logging so as not to delegate always to JUL

* wrap call to System.getProperty in a try block in case the client runs in a secured environment

Modified: trunk/src/main/org/hornetq/core/logging/Logger.java
===================================================================
--- trunk/src/main/org/hornetq/core/logging/Logger.java	2009-10-07 10:31:54 UTC (rev 8062)
+++ trunk/src/main/org/hornetq/core/logging/Logger.java	2009-10-07 11:22:11 UTC (rev 8063)
@@ -64,8 +64,15 @@
       LogDelegateFactory delegateFactory;
 
       // If a system property is specified then this overrides any delegate factory which is set
-      // programmatically - this is primarily of use so we can configure the logger delegate on the client side
-      String className = System.getProperty(LOGGER_DELEGATE_FACTORY_CLASS_NAME);
+      // programmatically - this is primarily of use so we can configure the logger delegate on the client side.
+      // call to System.getProperty is wrapped in a try block as it will fail if the client runs in a secured environment
+      String className = JULLogDelegateFactory.class.getName();
+      try
+      {
+         className = System.getProperty(LOGGER_DELEGATE_FACTORY_CLASS_NAME);
+      } catch (Exception e)
+      {
+      }
       
       if (className != null)
       {



More information about the hornetq-commits mailing list