asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject [10/13] asterixdb git commit: [ASTERIXDB-1564][CONF] Consistently Use Log4j2
Date Fri, 15 Dec 2017 16:18:08 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestUtil.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestUtil.java
index 9c3c393..6bdf351 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestUtil.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestUtil.java
@@ -21,11 +21,11 @@ package org.apache.asterix.test.sqlpp;
 import java.io.File;
 import java.util.Collection;
 import java.util.List;
-import java.util.logging.Logger;
 
 import org.apache.asterix.test.base.AsterixTestHelper;
 import org.apache.asterix.test.common.TestHelper;
 import org.apache.hyracks.util.file.FileUtil;
+import org.apache.logging.log4j.Logger;
 import org.junit.Assume;
 import org.junit.internal.AssumptionViolatedException;
 
@@ -74,7 +74,7 @@ class ParserTestUtil {
         } catch (Exception e) {
             if (!(e instanceof AssumptionViolatedException)) {
                 final String msg = "Test \"" + queryFile.getPath() + "\" FAILED!";
-                logger.severe(msg);
+                logger.error(msg);
                 throw new Exception(msg, e);
             } else {
                 throw e;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
index 0cac0c5..054da38 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/RuntimeParserTest.java
@@ -21,11 +21,12 @@ package org.apache.asterix.test.sqlpp;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.logging.Logger;
 
 import org.apache.asterix.test.common.TestExecutor;
 import org.apache.asterix.testframework.context.TestCaseContext;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -40,7 +41,7 @@ import org.junit.runners.Parameterized.Parameters;
 @RunWith(Parameterized.class)
 public class RuntimeParserTest {
 
-    protected static final Logger LOGGER = Logger.getLogger(RuntimeParserTest.class.getName());
+    protected static final Logger LOGGER = LogManager.getLogger();
 
     protected static final String PATH_ACTUAL = "target" + File.separator + "runtime_parserts" + File.separator;
     protected static final String PATH_BASE = StringUtils.join(new String[] { "src", "test", "resources", "runtimets" },

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
index b9b0cd6..b7a316d 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/SmokeParserTest.java
@@ -21,10 +21,11 @@ package org.apache.asterix.test.sqlpp;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.logging.Logger;
 
 import org.apache.asterix.test.base.AsterixTestHelper;
 import org.apache.hyracks.util.file.FileUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -35,7 +36,7 @@ import org.junit.runners.Parameterized.Parameters;
 @RunWith(Parameterized.class)
 public class SmokeParserTest {
 
-    private static final Logger LOGGER = Logger.getLogger(SmokeParserTest.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     private static final String EXTENSION_QUERY = "sqlpp";
     private static final String EXTENSION_RESULT = "ast";

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/resources/log4j2-test.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/log4j2-test.xml b/asterixdb/asterix-app/src/test/resources/log4j2-test.xml
new file mode 100644
index 0000000..d17fad7
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/log4j2-test.xml
@@ -0,0 +1,31 @@
+<!--
+ ! Licensed to the Apache Software Foundation (ASF) under one
+ ! or more contributor license agreements.  See the NOTICE file
+ ! distributed with this work for additional information
+ ! regarding copyright ownership.  The ASF licenses this file
+ ! to you under the Apache License, Version 2.0 (the
+ ! "License"); you may not use this file except in complianceo
+ ! with the License.  You may obtain a copy of the License at
+ !
+ !   http://www.apache.org/licenses/LICENSE-2.0
+ !
+ ! Unless required by applicable law or agreed to in writing,
+ ! software distributed under the License is distributed on an
+ ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ! KIND, either express or implied.  See the License for the
+ ! specific language governing permissions and limitations
+ ! under the License.
+ !-->
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_ERR">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <Root level="WARN"/>
+    <Logger name="org.apache.asterix.test" level="WARN">
+      <AppenderRef ref="Console"/>
+    </Logger>
+  </Loggers>
+</Configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
index 941c8bb..1160758 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_full/cluster_state_1_full.1.regexadm
@@ -13,7 +13,7 @@
     "compiler\.sortmemory" : 327680,
     "default\.dir" : "target/io/dir/asterixdb",
     "instance\.name" : "DEFAULT_INSTANCE",
-    "log\.level" : "WARNING",
+    "log\.level" : "WARN",
     "max\.wait\.active\.cluster" : 60,
     "messaging\.frame\.count" : 512,
     "messaging\.frame\.size" : 4096,

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
index bb495cd..d1c9fe0 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1_less/cluster_state_1_less.1.regexadm
@@ -13,7 +13,7 @@
     "compiler\.sortmemory" : 327680,
     "default\.dir" : "target/io/dir/asterixdb",
     "instance\.name" : "DEFAULT_INSTANCE",
-    "log\.level" : "WARNING",
+    "log\.level" : "WARN",
     "max\.wait\.active\.cluster" : 60,
     "messaging\.frame\.count" : 512,
     "messaging\.frame\.size" : 4096,

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/pom.xml b/asterixdb/asterix-common/pom.xml
index b909e91..8816bd0 100644
--- a/asterixdb/asterix-common/pom.xml
+++ b/asterixdb/asterix-common/pom.xml
@@ -240,10 +240,6 @@
       <artifactId>hyracks-storage-am-lsm-rtree</artifactId>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.rometools</groupId>
       <artifactId>rome</artifactId>
       <scope>test</scope>
@@ -291,5 +287,9 @@
       <groupId>args4j</groupId>
       <artifactId>args4j</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
   </dependencies>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
index e718903..4172a72 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/ExternalProperties.java
@@ -25,6 +25,7 @@ import static org.apache.hyracks.control.common.config.OptionTypes.STRING;
 import org.apache.hyracks.api.config.IOption;
 import org.apache.hyracks.api.config.IOptionType;
 import org.apache.hyracks.api.config.Section;
+import org.apache.logging.log4j.Level;
 
 public class ExternalProperties extends AbstractProperties {
 
@@ -34,7 +35,7 @@ public class ExternalProperties extends AbstractProperties {
         API_PORT(INTEGER, 19002, "The listen port of the API server"),
         ACTIVE_PORT(INTEGER, 19003, "The listen port of the active server"),
         NC_API_PORT(INTEGER, 19004, "The listen port of the node controller API server"),
-        LOG_LEVEL(LEVEL, java.util.logging.Level.WARNING, "The logging level for master and slave processes"),
+        LOG_LEVEL(LEVEL, Level.WARN, "The logging level for master and slave processes"),
         MAX_WAIT_ACTIVE_CLUSTER(INTEGER, 60, "The max pending time (in seconds) for cluster startup. After the " +
                 "threshold, if the cluster still is not up and running, it is considered unavailable"),
         CC_JAVA_OPTS(STRING, "-Xmx1024m", "The JVM options passed to the cluster controller process by managix"),
@@ -107,7 +108,7 @@ public class ExternalProperties extends AbstractProperties {
         return accessor.getInt(Option.ACTIVE_PORT);
     }
 
-    public java.util.logging.Level getLogLevel() {
+    public Level getLogLevel() {
         return accessor.getLoggingLevel(Option.LOG_LEVEL);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/GlobalConfig.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/GlobalConfig.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/GlobalConfig.java
index bc8fd5f..67d974b 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/GlobalConfig.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/GlobalConfig.java
@@ -20,14 +20,16 @@ package org.apache.asterix.common.config;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.logging.Logger;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class GlobalConfig {
     public static final boolean DEBUG = true;
 
     public static final String ASTERIX_LOGGER_NAME = "org.apache.asterix";
 
-    public static final Logger ASTERIX_LOGGER = Logger.getLogger(ASTERIX_LOGGER_NAME);
+    public static final Logger ASTERIX_LOGGER = LogManager.getLogger(ASTERIX_LOGGER_NAME);
 
     public static final String DEFAULT_CONFIG_FILE_NAME = "asterix-configuration.xml";
 
@@ -60,7 +62,7 @@ public class GlobalConfig {
             try {
                 fz = Integer.parseInt(frameSizeStr);
             } catch (NumberFormatException nfe) {
-                GlobalConfig.ASTERIX_LOGGER.warning("Wrong frame size size argument. Picking default value ("
+                GlobalConfig.ASTERIX_LOGGER.warn("Wrong frame size size argument. Picking default value ("
                         + GlobalConfig.DEFAULT_FRAME_SIZE + ") instead.\n");
             }
             if (fz >= 0) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/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 150705e..9c002b5 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
@@ -35,8 +35,6 @@ 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 org.apache.asterix.common.cluster.ClusterPartition;
 import org.apache.asterix.common.exceptions.AsterixException;
@@ -49,9 +47,11 @@ import org.apache.hyracks.api.config.IOptionType;
 import org.apache.hyracks.api.config.Section;
 import org.apache.hyracks.control.common.application.ConfigManagerApplicationConfig;
 import org.apache.hyracks.control.common.config.ConfigManager;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class PropertiesAccessor implements IApplicationConfig {
-    private static final Logger LOGGER = Logger.getLogger(PropertiesAccessor.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     private static final Map<IApplicationConfig, PropertiesAccessor> instances = new ConcurrentHashMap<>();
     private final Map<String, String[]> stores = new HashMap<>();
@@ -177,8 +177,8 @@ public class PropertiesAccessor implements IApplicationConfig {
         try {
             return value == null ? defaultValue : interpreter.parse(value);
         } catch (IllegalArgumentException e) {
-            if (LOGGER.isLoggable(Level.SEVERE)) {
-                LOGGER.severe("Invalid property value '" + value + "' for property '" + property + "'.\n" + "Default = "
+            if (LOGGER.isErrorEnabled()) {
+                LOGGER.error("Invalid property value '" + value + "' for property '" + property + "'.\n" + "Default = "
                         + defaultValue);
             }
             throw e;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
index f703c19..9d63818 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetInfo.java
@@ -22,14 +22,14 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMIndex;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class DatasetInfo extends Info implements Comparable<DatasetInfo> {
-    private static final Logger LOGGER = Logger.getLogger(DatasetInfo.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final Map<Long, IndexInfo> indexes;
     private final int datasetID;
     private int numActiveIOOps;
@@ -205,8 +205,8 @@ public class DatasetInfo extends Info implements Comparable<DatasetInfo> {
             }
         }
         if (numActiveIOOps < 0) {
-            if (LOGGER.isLoggable(Level.SEVERE)) {
-                LOGGER.severe("Number of IO operations cannot be negative for dataset: " + this);
+            if (LOGGER.isErrorEnabled()) {
+                LOGGER.error("Number of IO operations cannot be negative for dataset: " + this);
             }
             throw new IllegalStateException("Number of IO operations cannot be negative");
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
index 6a1ebfb..5d3d125 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetLifecycleManager.java
@@ -25,8 +25,6 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.api.IDatasetLifecycleManager;
 import org.apache.asterix.common.api.IDatasetMemoryManager;
@@ -54,10 +52,12 @@ import org.apache.hyracks.storage.am.lsm.common.impls.LSMComponentIdGenerator;
 import org.apache.hyracks.storage.common.IIndex;
 import org.apache.hyracks.storage.common.ILocalResourceRepository;
 import org.apache.hyracks.storage.common.LocalResource;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeCycleComponent {
 
-    private static final Logger LOGGER = Logger.getLogger(DatasetLifecycleManager.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final Map<Integer, DatasetResource> datasets = new ConcurrentHashMap<>();
     private final StorageProperties storageProperties;
     private final ILocalResourceRepository resourceRepository;
@@ -141,11 +141,11 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeC
 
         PrimaryIndexOperationTracker opTracker = dsr.getOpTracker();
         if (iInfo.getReferenceCount() != 0 || (opTracker != null && opTracker.getNumActiveOperations() != 0)) {
-            if (LOGGER.isLoggable(Level.SEVERE)) {
+            if (LOGGER.isErrorEnabled()) {
                 final String logMsg = String.format(
                         "Failed to drop in-use index %s. Ref count (%d), Operation tracker active ops (%d)",
                         resourcePath, iInfo.getReferenceCount(), opTracker.getNumActiveOperations());
-                LOGGER.severe(logMsg);
+                LOGGER.error(logMsg);
             }
             throw HyracksDataException.create(ErrorCode.CANNOT_DROP_IN_USE_INDEX,
                     StoragePathUtil.getIndexNameFromPath(resourcePath));
@@ -366,9 +366,7 @@ public class DatasetLifecycleManager implements IDatasetLifecycleManager, ILifeC
                             || opTracker.isFlushLogCreated() || opTracker.isFlushOnExit())) {
                         long firstLSN = ioCallback.getFirstLSN();
                         if (firstLSN < targetLSN) {
-                            if (LOGGER.isLoggable(Level.INFO)) {
-                                LOGGER.info("Checkpoint flush dataset " + dsr.getDatasetID());
-                            }
+                            LOGGER.info("Checkpoint flush dataset {}", dsr.getDatasetID());
                             opTracker.setFlushOnExit(true);
                             if (opTracker.getNumActiveOperations() == 0) {
                                 // No Modify operations currently, we need to trigger the flush and we can do so safely

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetMemoryManager.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetMemoryManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetMemoryManager.java
index 88f406e..e839d8c 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetMemoryManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/DatasetMemoryManager.java
@@ -20,17 +20,18 @@ package org.apache.asterix.common.context;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.api.IDatasetMemoryManager;
 import org.apache.asterix.common.config.StorageProperties;
 import org.apache.asterix.common.metadata.MetadataIndexImmutableProperties;
 import org.apache.hyracks.util.annotations.ThreadSafe;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 @ThreadSafe
 public class DatasetMemoryManager implements IDatasetMemoryManager {
 
-    private static final Logger LOGGER = Logger.getLogger(DatasetMemoryManager.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final Map<Integer, Long> allocatedMap = new HashMap<>();
     private final Map<Integer, Long> reservedMap = new HashMap<>();
     private long available;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/MetadataException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/MetadataException.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/MetadataException.java
index f04d19d..085f465 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/MetadataException.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/MetadataException.java
@@ -20,12 +20,14 @@
 package org.apache.asterix.common.exceptions;
 
 import java.io.Serializable;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class MetadataException extends CompilationException {
     private static final long serialVersionUID = 1L;
-    private static final Logger LOGGER = Logger.getLogger(MetadataException.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     @Deprecated
     /**
@@ -69,7 +71,7 @@ public class MetadataException extends CompilationException {
             return (MetadataException) cause;
         }
         if (cause instanceof InterruptedException && !Thread.currentThread().isInterrupted()) {
-            LOGGER.log(Level.WARNING, "Wrapping an InterruptedException in " + MetadataException.class.getSimpleName()
+            LOGGER.log(Level.WARN, "Wrapping an InterruptedException in " + MetadataException.class.getSimpleName()
                     + " and current thread is not interrupted", cause);
         }
         return new MetadataException(cause);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/ConcurrentFramePool.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/ConcurrentFramePool.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/ConcurrentFramePool.java
index d57a4fc..d522aa5 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/ConcurrentFramePool.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/ConcurrentFramePool.java
@@ -25,10 +25,11 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class ConcurrentFramePool {
     private static final boolean DEBUG = false;
@@ -36,7 +37,7 @@ public class ConcurrentFramePool {
             + "multiple of the default frame size";
     private static final String ERROR_LARGER_THAN_BUDGET_REQUEST = "The requested frame size"
             + " must not be greater than the allocated budget";
-    private static final Logger LOGGER = Logger.getLogger(ConcurrentFramePool.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final String nodeId;
     private final int budget;
     private final int defaultFrameSize;
@@ -233,7 +234,7 @@ public class ConcurrentFramePool {
                 try {
                     frameAction.call(freeBuffer);
                 } catch (Exception e) {
-                    LOGGER.log(Level.SEVERE,
+                    LOGGER.log(Level.ERROR,
                             "Error while attempting to answer a subscription. Buffer will be reclaimed", e);
                     // TODO(amoudi): Add test cases and get rid of recursion
                     if (handedOut == handedOutBeforeCall) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/FrameAction.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/FrameAction.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/FrameAction.java
index 366125a..c41f960 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/FrameAction.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/memory/FrameAction.java
@@ -19,11 +19,13 @@
 package org.apache.asterix.common.memory;
 
 import java.nio.ByteBuffer;
-import java.util.logging.Logger;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FrameAction {
     private static final boolean DEBUG = false;
-    private static final Logger LOGGER = Logger.getLogger(FrameAction.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private ByteBuffer allocated;
     private ByteBuffer frame;
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ChainedDeclusteringReplicationStrategy.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ChainedDeclusteringReplicationStrategy.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ChainedDeclusteringReplicationStrategy.java
index 1ef798c..6f66599 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ChainedDeclusteringReplicationStrategy.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/replication/ChainedDeclusteringReplicationStrategy.java
@@ -21,18 +21,18 @@ package org.apache.asterix.common.replication;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.config.ReplicationProperties;
 import org.apache.hyracks.api.config.IConfigManager;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.control.common.config.ConfigManager;
 import org.apache.hyracks.control.common.controllers.NCConfig;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class ChainedDeclusteringReplicationStrategy implements IReplicationStrategy {
 
-    private static final Logger LOGGER = Logger.getLogger(ChainedDeclusteringReplicationStrategy.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private int replicationFactor;
     private ReplicationProperties repProp;
     private ConfigManager configManager;
@@ -49,8 +49,8 @@ public class ChainedDeclusteringReplicationStrategy implements IReplicationStrat
         int nodeIndex = repProp.getNodeIds().indexOf(nodeId);
 
         if (nodeIndex == -1) {
-            if (LOGGER.isLoggable(Level.WARNING)) {
-                LOGGER.warning("Could not find node " + nodeId + " in cluster configurations");
+            if (LOGGER.isWarnEnabled()) {
+                LOGGER.warn("Could not find node " + nodeId + " in cluster configurations");
             }
             return Collections.emptySet();
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/InvokeUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/InvokeUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/InvokeUtil.java
index c7ac0f4..c718fca 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/InvokeUtil.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/InvokeUtil.java
@@ -21,12 +21,14 @@ package org.apache.asterix.common.utils;
 import java.io.IOException;
 import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class InvokeUtil {
 
-    private static final Logger LOGGER = Logger.getLogger(InvokeUtil.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     /**
      * Executes the passed interruptible, retrying if the operation is interrupted. Once the interruptible
@@ -136,7 +138,7 @@ public class InvokeUtil {
                 }
             } catch (Exception e) {
                 // ignore, retry after delay
-                LOGGER.log(Level.FINE, "Ignoring exception on retryLoop attempt, will retry after delay", e);
+                LOGGER.log(Level.DEBUG, "Ignoring exception on retryLoop attempt, will retry after delay", e);
             }
         }
         return false;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/StoragePathUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/StoragePathUtil.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/StoragePathUtil.java
index d2c5ad7..e83a75d 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/StoragePathUtil.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/utils/StoragePathUtil.java
@@ -33,12 +33,12 @@ import org.apache.hyracks.api.io.FileSplit;
 import org.apache.hyracks.api.io.MappedFileSplit;
 import org.apache.hyracks.dataflow.std.file.ConstantFileSplitProvider;
 import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class StoragePathUtil {
 
-    private static final Logger LOGGER = Logger.getLogger(StoragePathUtil.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private static Function<IndexPathElements, String> indexPathProvider;
 
     private StoragePathUtil() {
@@ -126,7 +126,7 @@ public class StoragePathUtil {
                 if (!success) {
                     throw new HyracksDataException("Unable to create spill file " + fileName);
                 } else {
-                    if (LOGGER.isEnabledFor(Level.INFO)) {
+                    if (LOGGER.isInfoEnabled()) {
                         LOGGER.info("Created spill file " + file.getAbsolutePath());
                     }
                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/client/FileFeedSocketAdapterClient.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/client/FileFeedSocketAdapterClient.java b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/client/FileFeedSocketAdapterClient.java
index 852173c..0e24b12 100644
--- a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/client/FileFeedSocketAdapterClient.java
+++ b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/client/FileFeedSocketAdapterClient.java
@@ -25,8 +25,10 @@ import java.io.OutputStream;
 import java.net.Socket;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FileFeedSocketAdapterClient implements ITestClient {
     private final int port;
@@ -37,7 +39,7 @@ public class FileFeedSocketAdapterClient implements ITestClient {
     private int batchSize;
     private int maxCount;
     private OutputStream out = null;
-    static final Logger LOGGER = Logger.getLogger(FileFeedSocketAdapterClient.class.getName());
+    static final Logger LOGGER = LogManager.getLogger();
 
     // expected args: url, source-file-path, max-count, batch-size, wait
     public FileFeedSocketAdapterClient(int port, String[] args) throws Exception {
@@ -61,7 +63,7 @@ public class FileFeedSocketAdapterClient implements ITestClient {
         try {
             socket = new Socket(url, port);
         } catch (IOException e) {
-            LOGGER.log(Level.WARNING, "Problem in creating socket against host " + url + " on the port " + port, e);
+            LOGGER.log(Level.WARN, "Problem in creating socket against host " + url + " on the port " + port, e);
             throw e;
         }
 
@@ -78,7 +80,7 @@ public class FileFeedSocketAdapterClient implements ITestClient {
                 }
                 out.write(b.array(), 0, b.limit());
                 recordCount++;
-                LOGGER.log(Level.FINE, "One record filed into feed");
+                LOGGER.log(Level.DEBUG, "One record filed into feed");
                 if (recordCount == maxCount) {
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
index 2ebed83..639e036 100644
--- a/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
+++ b/asterixdb/asterix-common/src/test/java/org/apache/asterix/test/server/RSSFeedServlet.java
@@ -25,13 +25,13 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Level;
 
 import org.apache.asterix.common.config.GlobalConfig;
 import org.apache.hyracks.http.api.IServletRequest;
 import org.apache.hyracks.http.api.IServletResponse;
 import org.apache.hyracks.http.server.AbstractServlet;
 import org.apache.hyracks.http.server.utils.HttpUtil;
+import org.apache.logging.log4j.Level;
 
 import com.rometools.rome.feed.synd.SyndContent;
 import com.rometools.rome.feed.synd.SyndContentImpl;
@@ -71,7 +71,7 @@ public class RSSFeedServlet extends AbstractServlet {
             SyndFeedOutput output = new SyndFeedOutput();
             output.output(feed, res.writer());
         } catch (FeedException | ParseException ex) {
-            GlobalConfig.ASTERIX_LOGGER.log(Level.WARNING, ex.getMessage(), ex);
+            GlobalConfig.ASTERIX_LOGGER.log(Level.WARN, ex.getMessage(), ex);
             String msg = COULD_NOT_GENERATE_FEED_ERROR;
             res.writer().print(msg);
             res.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/pom.xml b/asterixdb/asterix-external-data/pom.xml
index 6eca5c2..2a92e4b 100644
--- a/asterixdb/asterix-external-data/pom.xml
+++ b/asterixdb/asterix-external-data/pom.xml
@@ -318,10 +318,6 @@
       <artifactId>hyracks-storage-am-lsm-btree</artifactId>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.hyracks</groupId>
       <artifactId>algebricks-data</artifactId>
     </dependency>
@@ -416,5 +412,9 @@
       <artifactId>commons-collections4</artifactId>
       <version>4.1</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
index 0a47788..1bb9c11 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/adapter/factory/GenericAdapterFactory.java
@@ -20,8 +20,6 @@ package org.apache.asterix.external.adapter.factory;
 
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.api.IApplicationContext;
 import org.apache.asterix.common.api.INcApplicationContext;
@@ -54,11 +52,14 @@ import org.apache.hyracks.api.application.IServiceContext;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.FileSplit;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class GenericAdapterFactory implements IIndexingAdapterFactory, IAdapterFactory {
 
     private static final long serialVersionUID = 1L;
-    private static final Logger LOGGER = Logger.getLogger(GenericAdapterFactory.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private IExternalDataSourceFactory dataSourceFactory;
     private IDataParserFactory dataParserFactory;
     private ARecordType recordType;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/CounterTimerTupleForwarder.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/CounterTimerTupleForwarder.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/CounterTimerTupleForwarder.java
index b5adb32..10815d9 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/CounterTimerTupleForwarder.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/CounterTimerTupleForwarder.java
@@ -21,8 +21,6 @@ package org.apache.asterix.external.dataflow;
 import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.RuntimeDataException;
@@ -35,13 +33,15 @@ import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender;
 import org.apache.hyracks.dataflow.common.comm.util.FrameUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class CounterTimerTupleForwarder implements ITupleForwarder {
 
     public static final String BATCH_SIZE = "batch-size";
     public static final String BATCH_INTERVAL = "batch-interval";
 
-    private static final Logger LOGGER = Logger.getLogger(CounterTimerTupleForwarder.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     private FrameTupleAppender appender;
     private IFrame frame;
@@ -105,7 +105,7 @@ public class CounterTimerTupleForwarder implements ITupleForwarder {
     private void addTupleToFrame(ArrayTupleBuilder tb) throws HyracksDataException {
         if (tuplesInFrame == batchSize
                 || !appender.append(tb.getFieldEndOffsets(), tb.getByteArray(), 0, tb.getSize())) {
-            if (LOGGER.isLoggable(Level.INFO)) {
+            if (LOGGER.isInfoEnabled()) {
                 LOGGER.info("flushing frame containg (" + tuplesInFrame + ") tuples");
             }
             FrameUtils.flushFrame(frame.getBuffer(), writer);
@@ -148,7 +148,7 @@ public class CounterTimerTupleForwarder implements ITupleForwarder {
         public void run() {
             try {
                 if (tuplesInFrame > 0) {
-                    if (LOGGER.isLoggable(Level.INFO)) {
+                    if (LOGGER.isInfoEnabled()) {
                         LOGGER.info("TTL expired flushing frame (" + tuplesInFrame + ")");
                     }
                     synchronized (lock) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/FeedRecordDataFlowController.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/FeedRecordDataFlowController.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/FeedRecordDataFlowController.java
index 824f51a..8026efe 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/FeedRecordDataFlowController.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/FeedRecordDataFlowController.java
@@ -20,8 +20,6 @@ package org.apache.asterix.external.dataflow;
 
 import java.io.IOException;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.RuntimeDataException;
@@ -34,6 +32,9 @@ import org.apache.hyracks.api.comm.IFrameWriter;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowController {
     public static final String INCOMING_RECORDS_COUNT_FIELD_NAME = "incoming-records-count";
@@ -45,7 +46,7 @@ public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowControl
         STOPPED
     }
 
-    private static final Logger LOGGER = Logger.getLogger(FeedRecordDataFlowController.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final IRecordDataParser<T> dataParser;
     private final IRecordReader<T> recordReader;
     protected final AtomicBoolean closed = new AtomicBoolean(false);
@@ -90,7 +91,7 @@ public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowControl
                 }
             }
         } catch (HyracksDataException e) {
-            LOGGER.log(Level.WARNING, "Exception during ingestion", e);
+            LOGGER.log(Level.WARN, "Exception during ingestion", e);
             //if interrupted while waiting for a new record, then it is safe to not fail forward
             if (e.getComponent() == ErrorCode.ASTERIX
                     && (e.getErrorCode() == ErrorCode.FEED_STOPPED_WHILE_WAITING_FOR_A_NEW_RECORD)) {
@@ -113,7 +114,7 @@ public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowControl
         } catch (Exception e) {
             failure = e;
             tupleForwarder.fail();
-            LOGGER.log(Level.WARNING, "Failure while operating a feed source", e);
+            LOGGER.log(Level.WARN, "Failure while operating a feed source", e);
         } finally {
             failure = finish(failure);
         }
@@ -178,7 +179,7 @@ public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowControl
         try {
             recordReader.close();
         } catch (Exception th) {
-            LOGGER.log(Level.WARNING, "Failure during while operating a feed source", th);
+            LOGGER.log(Level.WARN, "Failure during while operating a feed source", th);
             hde = HyracksDataException.suppress(hde, th);
         }
         try {
@@ -203,7 +204,7 @@ public class FeedRecordDataFlowController<T> extends AbstractFeedDataFlowControl
         try {
             dataParser.parse(record, tb.getDataOutput());
         } catch (Exception e) {
-            LOGGER.log(Level.WARNING, ExternalDataConstants.ERROR_PARSE_RECORD, e);
+            LOGGER.log(Level.WARN, ExternalDataConstants.ERROR_PARSE_RECORD, e);
             feedLogManager.logRecord(record.toString(), ExternalDataConstants.ERROR_PARSE_RECORD);
             // continue the outer loop
             return false;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/RecordDataFlowController.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/RecordDataFlowController.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/RecordDataFlowController.java
index e780834..82251b6 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/RecordDataFlowController.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/dataflow/RecordDataFlowController.java
@@ -26,11 +26,9 @@ import org.apache.hyracks.api.comm.IFrameWriter;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
-import org.apache.log4j.Logger;
 
 public class RecordDataFlowController<T> extends AbstractDataFlowController {
 
-    private static final Logger LOGGER = Logger.getLogger(RecordDataFlowController.class.getName());
     protected final IRecordDataParser<T> dataParser;
     protected final IRecordReader<? extends T> recordReader;
     protected final int numOfTupleFields;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedExceptionHandler.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedExceptionHandler.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedExceptionHandler.java
index a8c6056..2fda99f 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedExceptionHandler.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedExceptionHandler.java
@@ -19,8 +19,6 @@
 package org.apache.asterix.external.feed.dataflow;
 
 import java.nio.ByteBuffer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.IExceptionHandler;
 import org.apache.asterix.external.util.FeedFrameUtil;
@@ -28,10 +26,13 @@ import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.ErrorCode;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class FeedExceptionHandler implements IExceptionHandler {
 
-    private static Logger LOGGER = Logger.getLogger(FeedExceptionHandler.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     // TODO: Enable logging
     private final IHyracksTaskContext ctx;
@@ -53,8 +54,8 @@ public class FeedExceptionHandler implements IExceptionHandler {
                     logExceptionCausingTuple(tupleIndex, th);
                 } catch (Exception ex) {
                     ex.addSuppressed(th);
-                    if (LOGGER.isLoggable(Level.WARNING)) {
-                        LOGGER.warning("Unable to log exception causing tuple due to..." + ex.getMessage());
+                    if (LOGGER.isWarnEnabled()) {
+                        LOGGER.warn("Unable to log exception causing tuple due to..." + ex.getMessage());
                     }
                 }
                 // TODO: Improve removeBadTuple. Right now, it creates lots of objects
@@ -64,8 +65,8 @@ public class FeedExceptionHandler implements IExceptionHandler {
             }
         } catch (Exception exception) {
             exception.printStackTrace();
-            if (LOGGER.isLoggable(Level.WARNING)) {
-                LOGGER.warning("Unable to handle exception " + exception.getMessage());
+            if (LOGGER.isWarnEnabled()) {
+                LOGGER.warn("Unable to handle exception " + exception.getMessage());
             }
             return null;
         }
@@ -73,6 +74,6 @@ public class FeedExceptionHandler implements IExceptionHandler {
 
     // TODO: Fix logging of exceptions
     private void logExceptionCausingTuple(int tupleIndex, Throwable e) throws HyracksDataException {
-        LOGGER.log(Level.WARNING, e.getMessage(), e);
+        LOGGER.log(Level.WARN, e.getMessage(), e);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedRuntimeInputHandler.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedRuntimeInputHandler.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedRuntimeInputHandler.java
index 90a8852..df5a3c4 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedRuntimeInputHandler.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FeedRuntimeInputHandler.java
@@ -21,8 +21,6 @@ package org.apache.asterix.external.feed.dataflow;
 import java.nio.ByteBuffer;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.active.ActiveRuntimeId;
 import org.apache.asterix.common.memory.ConcurrentFramePool;
@@ -35,6 +33,9 @@ import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.dataflow.common.comm.io.FrameTupleAccessor;
 import org.apache.hyracks.dataflow.std.base.AbstractUnaryInputUnaryOutputOperatorNodePushable;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * TODO: Add Failure cases unit tests for this class
@@ -49,7 +50,7 @@ import org.apache.hyracks.dataflow.std.base.AbstractUnaryInputUnaryOutputOperato
  **/
 public class FeedRuntimeInputHandler extends AbstractUnaryInputUnaryOutputOperatorNodePushable {
 
-    private static final Logger LOGGER = Logger.getLogger(FeedRuntimeInputHandler.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private static final double MAX_SPILL_USED_BEFORE_RESUME = 0.8;
     private static final boolean DEBUG = false;
     private static final ByteBuffer POISON_PILL = ByteBuffer.allocate(0);
@@ -109,7 +110,7 @@ public class FeedRuntimeInputHandler extends AbstractUnaryInputUnaryOutputOperat
         try {
             inbox.put(FAIL);
         } catch (InterruptedException e) {
-            LOGGER.log(Level.WARNING, "interrupted", e);
+            LOGGER.log(Level.WARN, "interrupted", e);
             Thread.currentThread().interrupt();
         }
     }
@@ -124,7 +125,7 @@ public class FeedRuntimeInputHandler extends AbstractUnaryInputUnaryOutputOperat
             inbox.put(POISON_PILL);
             consumerThread.join();
         } catch (InterruptedException e) {
-            LOGGER.log(Level.WARNING, "interrupted", e);
+            LOGGER.log(Level.WARN, "interrupted", e);
             Thread.currentThread().interrupt();
         }
         try {
@@ -132,7 +133,7 @@ public class FeedRuntimeInputHandler extends AbstractUnaryInputUnaryOutputOperat
                 spiller.close();
             }
         } catch (Throwable th) {
-            LOGGER.log(Level.WARNING, "exception closing spiller", th);
+            LOGGER.log(Level.WARN, "exception closing spiller", th);
         } finally {
             writer.close();
         }
@@ -159,8 +160,8 @@ public class FeedRuntimeInputHandler extends AbstractUnaryInputUnaryOutputOperat
                     discard(frame);
                     break;
                 default:
-                    if (LOGGER.isLoggable(Level.WARNING)) {
-                        LOGGER.warning("Ignoring incoming tuples in " + mode + " mode");
+                    if (LOGGER.isWarnEnabled()) {
+                        LOGGER.warn("Ignoring incoming tuples in " + mode + " mode");
                     }
                     break;
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FrameSpiller.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FrameSpiller.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FrameSpiller.java
index 09e03a3..e3630d3 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FrameSpiller.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/feed/dataflow/FrameSpiller.java
@@ -32,7 +32,8 @@ import org.apache.asterix.common.utils.StoragePathUtil;
 import org.apache.hyracks.api.comm.VSizeFrame;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * A {@link FrameSpiller} is used with feeds when "spill.to.disk.on.congestion" is set to true. The spiller spills
@@ -42,7 +43,7 @@ import org.apache.log4j.Logger;
  * "max.spill.size.on.disk"
  */
 public class FrameSpiller {
-    private static final Logger LOGGER = Logger.getLogger(FrameSpiller.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private static final int FRAMES_PER_FILE = 1024;
     public static final double MAX_SPILL_USED_BEFORE_RESUME = 0.8;
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/generator/TweetGenerator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/generator/TweetGenerator.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/generator/TweetGenerator.java
index 9431a24..17056a0 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/generator/TweetGenerator.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/generator/TweetGenerator.java
@@ -24,14 +24,14 @@ import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.external.generator.DataGenerator.TweetMessage;
 import org.apache.asterix.external.generator.DataGenerator.TweetMessageIterator;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class TweetGenerator {
-    private static final Logger LOGGER = Logger.getLogger(TweetGenerator.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     public static final String KEY_DURATION = "duration";
     public static final String KEY_TPS = "tps";
@@ -105,7 +105,7 @@ public class TweetGenerator {
             if (outputBuffer.position() > 0) {
                 flush();
             }
-            if (LOGGER.isLoggable(Level.INFO)) {
+            if (LOGGER.isInfoEnabled()) {
                 LOGGER.info("Reached end of batch. Tweet Count: [" + partition + "]" + tweetCount);
             }
             return false;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/IndexingScheduler.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/IndexingScheduler.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/IndexingScheduler.java
index 5212892..353e3ef 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/IndexingScheduler.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/indexing/IndexingScheduler.java
@@ -30,7 +30,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.PriorityQueue;
 import java.util.Random;
-import java.util.logging.Logger;
 
 import org.apache.hadoop.io.IntWritable;
 import org.apache.hadoop.mapred.InputSplit;
@@ -39,10 +38,11 @@ import org.apache.hyracks.api.client.IHyracksClientConnection;
 import org.apache.hyracks.api.client.NodeControllerInfo;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.exceptions.HyracksException;
-import org.apache.hyracks.hdfs.scheduler.Scheduler;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class IndexingScheduler {
-    private static final Logger LOGGER = Logger.getLogger(Scheduler.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     /** a list of NCs */
     private String[] NCs;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/RCLookupReader.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/RCLookupReader.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/RCLookupReader.java
index 3f9d90e..c404b80 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/RCLookupReader.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/RCLookupReader.java
@@ -31,14 +31,15 @@ import org.apache.asterix.hivecompat.io.RCFile.Reader;
 import org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Writable;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class RCLookupReader extends AbstractHDFSLookupRecordReader<BytesRefArrayWritable> {
     public RCLookupReader(ExternalFileIndexAccessor snapshotAccessor, FileSystem fs, Configuration conf) {
         super(snapshotAccessor, fs, conf);
     }
 
-    private static final Logger LOGGER = Logger.getLogger(RCLookupReader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private Reader reader;
     private LongWritable key = new LongWritable();
     private BytesRefArrayWritable value = new BytesRefArrayWritable();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/SequenceLookupReader.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/SequenceLookupReader.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/SequenceLookupReader.java
index 23e647f..46ae9ac 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/SequenceLookupReader.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/SequenceLookupReader.java
@@ -30,7 +30,8 @@ import org.apache.hadoop.io.SequenceFile.Reader;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class SequenceLookupReader extends AbstractCharRecordLookupReader {
 
@@ -38,7 +39,7 @@ public class SequenceLookupReader extends AbstractCharRecordLookupReader {
         super(snapshotAccessor, fs, conf);
     }
 
-    private static final Logger LOGGER = Logger.getLogger(SequenceLookupReader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private Reader reader;
     private Writable key;
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/TextLookupReader.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/TextLookupReader.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/TextLookupReader.java
index 2e1a11a..1ddeedb 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/TextLookupReader.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/hdfs/TextLookupReader.java
@@ -25,7 +25,8 @@ import org.apache.asterix.external.indexing.RecordId;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class TextLookupReader extends AbstractCharRecordLookupReader {
 
@@ -33,7 +34,7 @@ public class TextLookupReader extends AbstractCharRecordLookupReader {
         super(snapshotAccessor, fs, conf);
     }
 
-    private static final Logger LOGGER = Logger.getLogger(TextLookupReader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private HDFSTextLineReader reader;
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
index 44da608..b847b23 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/rss/RSSRecordReader.java
@@ -30,7 +30,8 @@ import org.apache.asterix.external.api.IRecordReader;
 import org.apache.asterix.external.dataflow.AbstractFeedDataFlowController;
 import org.apache.asterix.external.input.record.GenericRecord;
 import org.apache.asterix.external.util.FeedLogManager;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import com.rometools.fetcher.FeedFetcher;
 import com.rometools.fetcher.FetcherEvent;
@@ -45,7 +46,7 @@ import com.rometools.rome.io.FeedException;
 
 public class RSSRecordReader implements IRecordReader<SyndEntry> {
 
-    private static final Logger LOGGER = Logger.getLogger(RSSRecordReader.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private boolean modified = false;
     private Queue<SyndEntry> rssFeedBuffer = new LinkedList<>();
     private FeedFetcherCache feedInfoCache;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/twitter/TwitterRecordReaderFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/twitter/TwitterRecordReaderFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/twitter/TwitterRecordReaderFactory.java
index 3fb1d5f..8182dcd 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/twitter/TwitterRecordReaderFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/record/reader/twitter/TwitterRecordReaderFactory.java
@@ -22,8 +22,6 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.dataflow.ICcApplicationContext;
 import org.apache.asterix.common.exceptions.AsterixException;
@@ -40,13 +38,15 @@ import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.api.application.IServiceContext;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 import twitter4j.FilterQuery;
 
 public class TwitterRecordReaderFactory implements IRecordReaderFactory<String> {
 
     private static final long serialVersionUID = 1L;
-    private static final Logger LOGGER = Logger.getLogger(TwitterRecordReaderFactory.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     private static final String DEFAULT_INTERVAL = "10"; // 10 seconds
     private static final int INTAKE_CARDINALITY = 1; // degree of parallelism at intake stage
@@ -113,8 +113,8 @@ public class TwitterRecordReaderFactory implements IRecordReaderFactory<String>
                 }
             } else {
                 configuration.put(SearchAPIConstants.INTERVAL, DEFAULT_INTERVAL);
-                if (LOGGER.isLoggable(Level.WARNING)) {
-                    LOGGER.warning(" Parameter " + SearchAPIConstants.INTERVAL + " not defined, using default ("
+                if (LOGGER.isWarnEnabled()) {
+                    LOGGER.warn(" Parameter " + SearchAPIConstants.INTERVAL + " not defined, using default ("
                             + DEFAULT_INTERVAL + ")");
                 }
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/LocalFSInputStream.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/LocalFSInputStream.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/LocalFSInputStream.java
index c5ca129..36781fe 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/LocalFSInputStream.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/LocalFSInputStream.java
@@ -21,8 +21,6 @@ package org.apache.asterix.external.input.stream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.ExceptionUtils;
@@ -32,10 +30,13 @@ import org.apache.asterix.external.util.ExternalDataConstants;
 import org.apache.asterix.external.util.FeedLogManager;
 import org.apache.asterix.external.util.FileSystemWatcher;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class LocalFSInputStream extends AsterixInputStream {
 
-    private static final Logger LOGGER = Logger.getLogger(LocalFSInputStream.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final FileSystemWatcher watcher;
     private FileInputStream in;
     private byte lastByte;
@@ -163,18 +164,18 @@ public class LocalFSInputStream extends AsterixInputStream {
                 try {
                     logManager.logRecord(currentFile.getAbsolutePath(), "Corrupted input file");
                 } catch (IOException e) {
-                    LOGGER.log(Level.WARNING, "Filed to write to feed log file", e);
+                    LOGGER.log(Level.WARN, "Filed to write to feed log file", e);
                 }
-                LOGGER.log(Level.WARNING, "Corrupted input file: " + currentFile.getAbsolutePath());
+                LOGGER.log(Level.WARN, "Corrupted input file: " + currentFile.getAbsolutePath());
             }
             try {
                 advance();
                 return true;
             } catch (Exception e) {
-                LOGGER.log(Level.WARNING, "An exception was thrown while trying to skip a file", e);
+                LOGGER.log(Level.WARN, "An exception was thrown while trying to skip a file", e);
             }
         }
-        LOGGER.log(Level.WARNING, "Failed to recover from failure", th);
+        LOGGER.log(Level.WARN, "Failed to recover from failure", th);
         return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketServerInputStream.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketServerInputStream.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketServerInputStream.java
index ea55b5b..b487b40 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketServerInputStream.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/SocketServerInputStream.java
@@ -25,10 +25,11 @@ import java.net.Socket;
 
 import org.apache.asterix.external.api.AsterixInputStream;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class SocketServerInputStream extends AsterixInputStream {
-    private static final Logger LOGGER = Logger.getLogger(SocketServerInputStream.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private ServerSocket server;
     private Socket socket;
     private InputStream connectionStream;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/TwitterFirehoseInputStream.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/TwitterFirehoseInputStream.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/TwitterFirehoseInputStream.java
index 3928b19..0b9c4a2 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/TwitterFirehoseInputStream.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/TwitterFirehoseInputStream.java
@@ -25,16 +25,15 @@ import java.io.PipedOutputStream;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.external.api.AsterixInputStream;
 import org.apache.asterix.external.generator.TweetGenerator;
-import org.apache.hyracks.api.context.IHyracksTaskContext;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class TwitterFirehoseInputStream extends AsterixInputStream {
 
-    private static final Logger LOGGER = Logger.getLogger(TwitterFirehoseInputStream.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
     private final ExecutorService executorService;
     private final PipedOutputStream outputStream;
     private final PipedInputStream inputStream;
@@ -144,7 +143,7 @@ public class TwitterFirehoseInputStream extends AsterixInputStream {
                     os.close();
                     break;
                 } catch (Exception e) {
-                    LOGGER.warning("Exception in adapter " + e.getMessage());
+                    LOGGER.warn("Exception in adapter " + e.getMessage());
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
index d7afa13..6d91067 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/input/stream/factory/LocalFSInputStreamFactory.java
@@ -25,8 +25,6 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.Collectors;
 
 import org.apache.asterix.common.dataflow.ICcApplicationContext;
@@ -46,13 +44,16 @@ import org.apache.hyracks.api.application.IServiceContext;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.io.UnmanagedFileSplit;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class LocalFSInputStreamFactory implements IInputStreamFactory {
 
     private static final long serialVersionUID = 1L;
 
     protected static final INodeResolver DEFAULT_NODE_RESOLVER = new NodeResolverFactory().createNodeResolver();
-    protected static final Logger LOGGER = Logger.getLogger(LocalFSInputStreamFactory.class.getName());
+    protected static final Logger LOGGER = LogManager.getLogger();
     protected static INodeResolver nodeResolver;
     protected Map<String, String> configuration;
     protected UnmanagedFileSplit[] inputFileSplits;
@@ -155,8 +156,8 @@ public class LocalFSInputStreamFactory implements IInputStreamFactory {
                         .createNodeResolver();
 
             } catch (Exception e) {
-                if (LOGGER.isLoggable(Level.WARNING)) {
-                    LOGGER.log(Level.WARNING, "Unable to create node resolver from the configured classname "
+                if (LOGGER.isWarnEnabled()) {
+                    LOGGER.log(Level.WARN, "Unable to create node resolver from the configured classname "
                             + configuredNodeResolverFactory + "\n" + e.getMessage());
                 }
                 nodeResolver = DEFAULT_NODE_RESOLVER;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
index ac474a5..8f35c80 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/java/JObjectAccessors.java
@@ -23,8 +23,6 @@ import java.io.DataInputStream;
 import java.io.IOException;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.RuntimeDataException;
@@ -93,10 +91,13 @@ import org.apache.asterix.om.types.TypeTagUtil;
 import org.apache.asterix.om.util.container.IObjectPool;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.util.string.UTF8StringReader;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class JObjectAccessors {
 
-    private static final Logger LOGGER = Logger.getLogger(JObjectAccessors.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     private JObjectAccessors() {
     }
@@ -543,7 +544,7 @@ public class JObjectAccessors {
                 }
 
             } catch (Exception e) {
-                LOGGER.log(Level.WARNING, "Failure while accessing a java record", e);
+                LOGGER.log(Level.WARN, "Failure while accessing a java record", e);
                 throw HyracksDataException.create(e);
             }
             return jRecord;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/ExternalDatasetIndexesCommitOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/ExternalDatasetIndexesCommitOperatorDescriptor.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/ExternalDatasetIndexesCommitOperatorDescriptor.java
index fe4f93c..337946b 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/ExternalDatasetIndexesCommitOperatorDescriptor.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/ExternalDatasetIndexesCommitOperatorDescriptor.java
@@ -29,12 +29,12 @@ import org.apache.hyracks.storage.am.common.api.IIndexDataflowHelper;
 import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
 import org.apache.hyracks.storage.am.lsm.common.api.ITwoPCIndex;
 import org.apache.hyracks.storage.common.IIndex;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class ExternalDatasetIndexesCommitOperatorDescriptor extends AbstractExternalDatasetIndexesOperatorDescriptor {
     private static final long serialVersionUID = 1L;
-    private static final Logger LOGGER =
-            Logger.getLogger(ExternalDatasetIndexesCommitOperatorDescriptor.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     public ExternalDatasetIndexesCommitOperatorDescriptor(IOperatorDescriptorRegistry spec,
             List<IIndexDataflowHelperFactory> indexesDataflowHelperFactories) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/af4018dd/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/FeedIntakeOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/FeedIntakeOperatorDescriptor.java b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/FeedIntakeOperatorDescriptor.java
index 770e978..e7f8564 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/FeedIntakeOperatorDescriptor.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/operators/FeedIntakeOperatorDescriptor.java
@@ -19,7 +19,6 @@
 package org.apache.asterix.external.operators;
 
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.apache.asterix.active.EntityId;
 import org.apache.asterix.common.api.INcApplicationContext;
@@ -37,6 +36,8 @@ import org.apache.hyracks.api.dataflow.value.RecordDescriptor;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobSpecification;
 import org.apache.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 /**
  * An operator responsible for establishing connection with external data source and parsing,
@@ -48,7 +49,7 @@ public class FeedIntakeOperatorDescriptor extends AbstractSingleActivityOperator
 
     private static final long serialVersionUID = 1L;
 
-    private static final Logger LOGGER = Logger.getLogger(FeedIntakeOperatorDescriptor.class.getName());
+    private static final Logger LOGGER = LogManager.getLogger();
 
     /** The unique identifier of the feed that is being ingested. **/
     private final EntityId feedId;
@@ -117,7 +118,7 @@ public class FeedIntakeOperatorDescriptor extends AbstractSingleActivityOperator
             RuntimeDataException err = new RuntimeDataException(
                     ErrorCode.OPERATORS_FEED_INTAKE_OPERATOR_DESCRIPTOR_CLASSLOADER_NOT_CONFIGURED, adaptorLibraryName,
                     feedId.getDataverse());
-            LOGGER.severe(err.getMessage());
+            LOGGER.error(err.getMessage());
             throw err;
         }
         return adapterFactory;


Mime
View raw message