accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3450 Push audit configuration into Log4jConfiguration.
Date Mon, 29 Dec 2014 03:19:23 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 2e5064e36 -> 794e68cf7
  refs/heads/master c2f59467a -> 3899eb0f3


ACCUMULO-3450 Push audit configuration into Log4jConfiguration.

Ensure that the audit configuration is reset when the logging
subsystem is reset.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/794e68cf
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/794e68cf
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/794e68cf

Branch: refs/heads/1.6
Commit: 794e68cf70b5b86832ee0187749abbd7550096a1
Parents: 2e5064e
Author: Josh Elser <elserj@apache.org>
Authored: Wed Dec 24 17:29:36 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Dec 24 17:29:36 2014 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/accumulo/server/Accumulo.java   | 7 -------
 .../apache/accumulo/server/watcher/Log4jConfiguration.java   | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/794e68cf/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
index 8fc2327..46ec64f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/Accumulo.java
@@ -54,7 +54,6 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.log4j.Logger;
 import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.xml.DOMConfigurator;
 import org.apache.zookeeper.KeeperException;
 
 public class Accumulo {
@@ -161,15 +160,9 @@ public class Accumulo {
     // Turn off messages about not being able to reach the remote logger... we protect against
that.
     LogLog.setQuietMode(true);
 
-    // Read the auditing config
-    String auditConfig = String.format("%s/auditLog.xml", System.getenv("ACCUMULO_CONF_DIR"));
-
     // Set up local file-based logging right away
     Log4jConfiguration logConf = new Log4jConfiguration(logConfigFile);
     logConf.resetLogger();
-
-    // Watch the auditLog.xml for the future updates
-    DOMConfigurator.configureAndWatch(auditConfig, 5000);
   }
 
   public static void init(VolumeManager fs, ServerConfiguration serverConfig, String application)
throws IOException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/794e68cf/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
b/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
index 0cac730..7ff5542 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/watcher/Log4jConfiguration.java
@@ -30,11 +30,15 @@ public class Log4jConfiguration {
   private final boolean usingProperties;
   private final String filename;
   private final File log4jFile;
+  private final String auditConfig;
 
   public Log4jConfiguration(String filename) {
     usingProperties = (filename != null && filename.endsWith(".properties"));
     this.filename = filename;
     log4jFile = new File(filename);
+
+    // Read the auditing config
+    auditConfig = String.format("%s/auditLog.xml", System.getenv("ACCUMULO_CONF_DIR"));
   }
 
   public boolean isUsingProperties() {
@@ -51,6 +55,10 @@ public class Log4jConfiguration {
       } else {
         new DOMConfigurator().doConfigure(filename, LogManager.getLoggerRepository());
       }
+
+      // Watch the auditLog.xml for the future updates. Because we reset the subsystem, we
have to reconfigure auditing, too.
+      DOMConfigurator.configureAndWatch(auditConfig, 5000l);
     }
+
   }
 }


Mime
View raw message