activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1058613 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java
Date Thu, 13 Jan 2011 15:41:34 GMT
Author: dejanb
Date: Thu Jan 13 15:41:33 2011
New Revision: 1058613

URL: http://svn.apache.org/viewvc?rev=1058613&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3100 - setting factory instead of using system property

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java?rev=1058613&r1=1058612&r2=1058613&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/util/AuditLogService.java
Thu Jan 13 15:41:33 2011
@@ -16,13 +16,8 @@
  */
 package org.apache.activemq.broker.util;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 public class AuditLogService {
 
-    private static final Log LOG = LogFactory.getLog(AuditLogService.class);
-
     private AuditLogFactory factory;
 
     private static AuditLogService auditLog;
@@ -35,14 +30,7 @@ public class AuditLogService {
     }
 
     private AuditLogService() {
-	   String auditLogFactory = System.getProperty("org.apache.activemq.audit.factory", "org.apache.activemq.broker.util.DefaultAuditLogFactory");
-       try {
-           factory = (AuditLogFactory) Class.forName(auditLogFactory).newInstance();
-       } catch (Exception e) {
-           LOG.warn("Cannot instantiate audit log factory '" + auditLogFactory + "', using
default audit log factory", e);
-           factory = new DefaultAuditLogFactory();
-        }
-
+        factory = new DefaultAuditLogFactory();
     }
 
     public void log(String message) {
@@ -50,4 +38,8 @@ public class AuditLogService {
             log.log(message);
         }
     }
-}
+
+    public void setFactory(AuditLogFactory factory) {
+        this.factory = factory;
+    }
+}
\ No newline at end of file



Mime
View raw message