asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Log Message When Applying Logging Level
Date Tue, 21 Mar 2017 05:14:51 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 9564c1907 -> ebf1bc227


Log Message When Applying Logging Level

Log a message when resetting the log level, to indicate when the loggers
are being configured and with what level

Change-Id: I38d939a464cc4ea0e5ec9cca88838f083677cf5e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1604
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>


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

Branch: refs/heads/master
Commit: ebf1bc2279bd21320af1d6845755fcddd9ef11f5
Parents: 9564c19
Author: Michael Blow <mblow@apache.org>
Authored: Mon Mar 20 18:59:52 2017 -0700
Committer: Michael Blow <mblow@apache.org>
Committed: Mon Mar 20 22:14:31 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/asterix/app/nc/NCAppRuntimeContext.java | 3 ---
 .../org/apache/asterix/hyracks/bootstrap/CCApplication.java | 9 +++++++++
 .../org/apache/asterix/hyracks/bootstrap/NCApplication.java | 8 ++++++++
 .../org/apache/asterix/runtime/utils/AppContextInfo.java    | 3 ---
 .../org/apache/hyracks/control/cc/BaseCCApplication.java    | 9 +++++++++
 .../org/apache/hyracks/control/nc/BaseNCApplication.java    | 7 +++++++
 6 files changed, 33 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
index 183a0ed..a0b4a2a 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
@@ -165,9 +165,6 @@ public class NCAppRuntimeContext implements IAppRuntimeContext {
 
     @Override
     public void initialize(boolean initialRun) throws IOException, ACIDException {
-        Logger.getLogger("org.apache.asterix").setLevel(externalProperties.getLogLevel());
-        Logger.getLogger("org.apache.hyracks").setLevel(externalProperties.getLogLevel());
-
         ioManager = ncServiceContext.getIoManager();
         threadExecutor = new ThreadExecutor(ncServiceContext.getThreadFactory());
         fileMapManager = new FileMapManager(ioManager);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
index fcc6f1f..55de9c7 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
@@ -106,6 +106,8 @@ public class CCApplication extends BaseCCApplication {
         ICCMessageBroker messageBroker = new CCMessageBroker(controllerService);
         this.ccServiceCtx = (ICCServiceContext) serviceCtx;
 
+        configureLoggingLevel(ccServiceCtx.getAppConfig().getLoggingLevel(ExternalProperties.Option.LOG_LEVEL));
+
         if (LOGGER.isLoggable(Level.INFO)) {
             LOGGER.info("Starting Asterix cluster controller");
         }
@@ -148,6 +150,13 @@ public class CCApplication extends BaseCCApplication {
         jobCapacityController = new JobCapacityController(controllerService.getResourceManager());
     }
 
+    @Override
+    protected void configureLoggingLevel(Level level) {
+        super.configureLoggingLevel(level);
+        LOGGER.info("Setting Asterix log level to " + level);
+        Logger.getLogger("org.apache.asterix").setLevel(level);
+    }
+
     protected List<AsterixExtension> getExtensions() {
         return AppContextInfo.INSTANCE.getExtensionProperties().getExtensions();
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
index aac7bc3..aaf3d7a 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
@@ -31,6 +31,7 @@ import org.apache.asterix.common.api.AsterixThreadFactory;
 import org.apache.asterix.common.api.IAppRuntimeContext;
 import org.apache.asterix.common.config.AsterixExtension;
 import org.apache.asterix.common.config.ClusterProperties;
+import org.apache.asterix.common.config.ExternalProperties;
 import org.apache.asterix.common.config.IPropertiesProvider;
 import org.apache.asterix.common.config.MessagingProperties;
 import org.apache.asterix.common.config.MetadataProperties;
@@ -83,6 +84,7 @@ public class NCApplication extends BaseNCApplication {
         if (LOGGER.isLoggable(Level.INFO)) {
             LOGGER.info("Starting Asterix node controller: " + nodeId);
         }
+        configureLoggingLevel(ncServiceCtx.getAppConfig().getLoggingLevel(ExternalProperties.Option.LOG_LEVEL));
 
         final NodeControllerService controllerService = (NodeControllerService) ncServiceCtx.getControllerService();
 
@@ -124,6 +126,12 @@ public class NCApplication extends BaseNCApplication {
         performLocalCleanUp();
     }
 
+    @Override
+    protected void configureLoggingLevel(Level level) {
+        super.configureLoggingLevel(level);
+        Logger.getLogger("org.apache.asterix").setLevel(level);
+    }
+
     protected List<AsterixExtension> getExtensions() {
         return Collections.emptyList();
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/AppContextInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/AppContextInfo.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/AppContextInfo.java
index 4185b26..ad510e4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/AppContextInfo.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/AppContextInfo.java
@@ -110,9 +110,6 @@ public class AppContextInfo implements IApplicationContextInfo, IPropertiesProvi
         INSTANCE.nodeProperties = new NodeProperties(propertiesAccessor);
         INSTANCE.metadataBootstrapSupplier = metadataBootstrapSupplier;
         INSTANCE.globalRecoveryManager = globalRecoveryManager;
-
-        Logger.getLogger("org.apache.asterix").setLevel(INSTANCE.externalProperties.getLogLevel());
-        Logger.getLogger("org.apache.hyracks").setLevel(INSTANCE.externalProperties.getLogLevel());
     }
 
     public boolean initialized() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java
index 8e423b8..b94cf01 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/BaseCCApplication.java
@@ -19,6 +19,8 @@
 package org.apache.hyracks.control.cc;
 
 import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.hyracks.api.application.ICCApplication;
 import org.apache.hyracks.api.application.IServiceContext;
@@ -31,6 +33,7 @@ import org.apache.hyracks.control.common.controllers.ControllerConfig;
 import org.apache.hyracks.control.common.controllers.NCConfig;
 
 public class BaseCCApplication implements ICCApplication {
+    private static final Logger LOGGER = Logger.getLogger(BaseCCApplication.class.getName());
     public static final ICCApplication INSTANCE = new BaseCCApplication();
 
     protected BaseCCApplication() {
@@ -70,4 +73,10 @@ public class BaseCCApplication implements ICCApplication {
     public Object getApplicationContext() {
         return null;
     }
+
+    protected void configureLoggingLevel(Level level) {
+        LOGGER.info("Setting Hyracks log level to " + level);
+        Logger.getLogger("org.apache.hyracks").setLevel(level);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ebf1bc22/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java
index 4a5805e..baf69d0 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/BaseNCApplication.java
@@ -20,6 +20,8 @@ package org.apache.hyracks.control.nc;
 
 import java.lang.management.ManagementFactory;
 import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.hyracks.api.application.INCApplication;
 import org.apache.hyracks.api.application.IServiceContext;
@@ -76,4 +78,9 @@ public class BaseNCApplication implements INCApplication {
     public Object getApplicationContext() {
         return null;
     }
+
+    protected void configureLoggingLevel(Level level) {
+        Logger.getLogger("org.apache.hyracks").setLevel(level);
+    }
+
 }


Mime
View raw message