Till Westmann has submitted this change and it was merged. Change subject: Move to java.util.logging as that is configured ......................................................................
Move to java.util.logging as that is configured Change-Id: Ib4f751e65787d24ec017b70e12715b059f98c3d2 Reviewed-on: https://asterix-gerrit.ics.uci.edu/1767 Sonar-Qube: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> BAD: Jenkins <[email protected]> Integration-Tests: Jenkins <[email protected]> Reviewed-by: Michael Blow <[email protected]> --- M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/PropertiesAccessor.java 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Michael Blow: Looks good to me, approved Jenkins: Verified; No violations found; No violations found; Verified 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.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.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 @@ 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 @@ 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 @@ 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; -- To view, visit https://asterix-gerrit.ics.uci.edu/1767 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4f751e65787d24ec017b70e12715b059f98c3d2 Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Till Westmann <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
