asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: Move to java.util.logging as that is configured
Date Fri, 26 May 2017 17:03:26 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 41b3aa35e -> c3b7a0f09


Move to java.util.logging as that is configured

Change-Id: Ib4f751e65787d24ec017b70e12715b059f98c3d2
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1767
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>


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

Branch: refs/heads/master
Commit: c3b7a0f096849a65abf311792601d7e51e063f41
Parents: 41b3aa3
Author: Till Westmann <tillw@tcbm.attlocal.net>
Authored: Sun May 21 08:00:38 2017 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Fri May 26 10:03:07 2017 -0700

----------------------------------------------------------------------
 .../asterix/common/config/PropertiesAccessor.java    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c3b7a0f0/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
index 1ea512a..c5ec1c0 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java
@@ -40,6 +40,8 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Predicate;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.stream.Stream;
 
 import javax.xml.bind.JAXBContext;
@@ -65,8 +67,6 @@ import org.apache.hyracks.control.common.application.ConfigManagerApplicationCon
 import org.apache.hyracks.control.common.config.ConfigManager;
 import org.apache.hyracks.control.common.controllers.ControllerConfig;
 import org.apache.hyracks.control.common.controllers.NCConfig;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
 
 public class PropertiesAccessor implements IApplicationConfig {
     private static final Logger LOGGER = Logger.getLogger(PropertiesAccessor.class.getName());
@@ -159,7 +159,7 @@ public class PropertiesAccessor implements IApplicationConfig {
                     option = optionTemp;
                 }
                 if (option == null) {
-                    LOGGER.warn("Ignoring unknown property: " + p.getName());
+                    LOGGER.warning("Ignoring unknown property: " + p.getName());
                 } else {
                     configManager.set(option, option.type().parse(p.getValue()));
                 }
@@ -197,8 +197,9 @@ public class PropertiesAccessor implements IApplicationConfig {
         try (FileInputStream is = new FileInputStream(fileName)) {
             return configure(is, fileName);
         } catch (FileNotFoundException fnf1) {
-            LOGGER.warn("Failed to get configuration file " + fileName + " as FileInputStream.
FileNotFoundException");
-            LOGGER.warn("Attempting to get default configuration file " + GlobalConfig.DEFAULT_CONFIG_FILE_NAME
+            LOGGER.warning(
+                    "Failed to get configuration file " + fileName + " as FileInputStream.
FileNotFoundException");
+            LOGGER.warning("Attempting to get default configuration file " + GlobalConfig.DEFAULT_CONFIG_FILE_NAME
                     + " as FileInputStream");
             try (FileInputStream fis = new FileInputStream(GlobalConfig.DEFAULT_CONFIG_FILE_NAME))
{
                 return configure(fis, GlobalConfig.DEFAULT_CONFIG_FILE_NAME);
@@ -300,8 +301,8 @@ public class PropertiesAccessor implements IApplicationConfig {
         try {
             return value == null ? defaultValue : interpreter.parse(value);
         } catch (IllegalArgumentException e) {
-            if (LOGGER.isEnabledFor(Level.ERROR)) {
-                LOGGER.error("Invalid property value '" + value + "' for property '" + property
+ "'.\n" +
+            if (LOGGER.isLoggable(Level.SEVERE)) {
+                LOGGER.severe("Invalid property value '" + value + "' for property '" + property
+ "'.\n" +
                         "Default = " + defaultValue);
             }
             throw e;


Mime
View raw message