You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by sn...@apache.org on 2019/05/07 22:26:26 UTC

[incubator-pinot] branch master updated: Migration to log4j2 (#4139)

This is an automated email from the ASF dual-hosted git repository.

snlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 84a34a2  Migration to log4j2 (#4139)
84a34a2 is described below

commit 84a34a215b026f8efcc878a6957966cac0d623eb
Author: Seunghyun Lee <sn...@linkedin.com>
AuthorDate: Tue May 7 15:26:19 2019 -0700

    Migration to log4j2 (#4139)
    
    As stated in #3913, log4j has been identified as a
    performance bottleneck for high qps use cases because
    it is using a global lock for "Category.callAppenders()"
    method.
    
    log4j2 supports async logging so this migration should
    improve the performance for high qps use cases.
---
 pinot-api/pom.xml                                  |   4 -
 pinot-api/src/test/resources/log4j.properties      |   6 -
 pinot-api/src/test/resources/log4j2.xml            |  35 ++++++
 pinot-broker/src/test/resources/log4j.properties   |   6 -
 pinot-broker/src/test/resources/log4j2.xml         |  35 ++++++
 pinot-common/pom.xml                               |  12 +-
 .../org/apache/pinot/common/utils/LogUtils.java    |  40 -------
 .../org/apache/pinot/common/utils/ZkStarter.java   |   4 +
 .../src/main/resources/log4j-fatal-only.properties |  24 ----
 .../src/main/resources/log4j2-fatal-only.xml       |  35 ++++++
 pinot-common/src/test/resources/log4j.properties   |   6 -
 pinot-common/src/test/resources/log4j2.xml         |  35 ++++++
 pinot-controller/pom.xml                           |   4 -
 .../src/test/resources/log4j.properties            |   6 -
 pinot-controller/src/test/resources/log4j2.xml     |  35 ++++++
 pinot-core/pom.xml                                 |   4 -
 pinot-core/src/test/resources/log4j.properties     |   6 -
 pinot-core/src/test/resources/log4j2.xml           |  35 ++++++
 .../src/test/resources/log4j.properties            |   6 -
 .../src/test/resources/log4j2.xml                  |  35 ++++++
 pinot-minion/src/test/resources/log4j.properties   |   6 -
 pinot-minion/src/test/resources/log4j2.xml         |  35 ++++++
 pinot-perf/pom.xml                                 |   2 +-
 pinot-perf/src/main/resources/log4j.properties     |  50 --------
 pinot-perf/src/main/resources/log4j2.xml           |  79 +++++++++++++
 pinot-tools/pom.xml                                |  30 ++---
 .../org/apache/pinot/tools/HybridQuickstart.java   |   1 -
 .../java/org/apache/pinot/tools/Quickstart.java    |  15 ---
 .../org/apache/pinot/tools/RealtimeQuickStart.java |   1 -
 .../resources/conf/pinot-admin-log4j.properties    |  46 --------
 .../src/main/resources/conf/pinot-admin-log4j2.xml |  53 +++++++++
 .../resources/conf/pinot-broker-log4j.properties   |  39 -------
 .../main/resources/conf/pinot-broker-log4j2.xml    |  47 ++++++++
 .../conf/pinot-controller-log4j.properties         |  40 -------
 .../resources/conf/pinot-controller-log4j2.xml     |  47 ++++++++
 .../resources/conf/pinot-server-log4j.properties   |  39 -------
 .../main/resources/conf/pinot-server-log4j2.xml    |  47 ++++++++
 .../resources/conf/pinot-tools-log4j.properties    |  48 --------
 .../src/main/resources/conf/pinot-tools-log4j2.xml |  79 +++++++++++++
 .../resources/conf/quickstart-log4j.properties     |  48 --------
 .../src/main/resources/conf/quickstart-log4j2.xml  |  75 ++++++++++++
 .../conf/quickstart-offline-log4j.properties       |  46 --------
 .../conf/quickstart-realtime-log4j.properties      |  46 --------
 pinot-tools/src/main/resources/log4j.properties    |  51 ---------
 pinot-tools/src/main/resources/log4j2.xml          |  79 +++++++++++++
 pinot-transport/pom.xml                            |   4 -
 pom.xml                                            | 126 ++++++++++++++++++---
 .../thirdeye-hadoop/src/main/resources/log4j2.xml  |  35 ++++++
 48 files changed, 965 insertions(+), 622 deletions(-)

diff --git a/pinot-api/pom.xml b/pinot-api/pom.xml
index 4ce1f97..6fce9cf 100644
--- a/pinot-api/pom.xml
+++ b/pinot-api/pom.xml
@@ -88,10 +88,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.google.code.findbugs</groupId>
       <artifactId>jsr305</artifactId>
     </dependency>
diff --git a/pinot-api/src/test/resources/log4j.properties b/pinot-api/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-api/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-api/src/test/resources/log4j2.xml b/pinot-api/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-api/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-broker/src/test/resources/log4j.properties b/pinot-broker/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-broker/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-broker/src/test/resources/log4j2.xml b/pinot-broker/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-broker/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-common/pom.xml b/pinot-common/pom.xml
index 0b12021..8f8a708 100644
--- a/pinot-common/pom.xml
+++ b/pinot-common/pom.xml
@@ -128,8 +128,16 @@
       <artifactId>snappy-java</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.lmax</groupId>
+      <artifactId>disruptor</artifactId>
     </dependency>
     <dependency>
       <groupId>joda-time</groupId>
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/utils/LogUtils.java b/pinot-common/src/main/java/org/apache/pinot/common/utils/LogUtils.java
deleted file mode 100644
index 4e8a624..0000000
--- a/pinot-common/src/main/java/org/apache/pinot/common/utils/LogUtils.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * 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 compliance
- * 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.
- */
-package org.apache.pinot.common.utils;
-
-import java.util.Enumeration;
-import java.util.List;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-
-public class LogUtils {
-  public static void setLogLevel(List<String> packagePrefixes, Level level) {
-    Enumeration<Logger> loggers = Logger.getRootLogger().getLoggerRepository().getCurrentLoggers();
-    while (loggers.hasMoreElements()) {
-      Logger logger = loggers.nextElement();
-      for (String prefix : packagePrefixes) {
-        if (logger.getName().startsWith(prefix)) {
-          logger.setLevel(level);
-          break;
-        }
-      }
-    }
-  }
-}
diff --git a/pinot-common/src/main/java/org/apache/pinot/common/utils/ZkStarter.java b/pinot-common/src/main/java/org/apache/pinot/common/utils/ZkStarter.java
index a9489f8..0941d19 100644
--- a/pinot-common/src/main/java/org/apache/pinot/common/utils/ZkStarter.java
+++ b/pinot-common/src/main/java/org/apache/pinot/common/utils/ZkStarter.java
@@ -52,6 +52,10 @@ public class ZkStarter {
     @Override
     public void initializeAndRun(String[] args)
         throws QuorumPeerConfig.ConfigException, IOException {
+      // org.apache.log4j.jmx.* is not compatible under log4j-1.2-api, which provides the backward compatibility for
+      // log4j 1.* api for log4j2. In order to avoid 'class not found error', the following line disables log4j jmx
+      // bean registration for local zookeeper instance
+      System.setProperty("zookeeper.jmx.log4j.disable", "true");
       super.initializeAndRun(args);
     }
 
diff --git a/pinot-common/src/main/resources/log4j-fatal-only.properties b/pinot-common/src/main/resources/log4j-fatal-only.properties
deleted file mode 100644
index fc94581..0000000
--- a/pinot-common/src/main/resources/log4j-fatal-only.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=FATAL, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p %c{1} [%x] - %m%n
diff --git a/pinot-common/src/main/resources/log4j2-fatal-only.xml b/pinot-common/src/main/resources/log4j2-fatal-only.xml
new file mode 100644
index 0000000..e5bf0a0
--- /dev/null
+++ b/pinot-common/src/main/resources/log4j2-fatal-only.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="fatal" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-common/src/test/resources/log4j.properties b/pinot-common/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-common/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-common/src/test/resources/log4j2.xml b/pinot-common/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-common/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-controller/pom.xml b/pinot-controller/pom.xml
index 6876c22..7092a50 100644
--- a/pinot-controller/pom.xml
+++ b/pinot-controller/pom.xml
@@ -95,10 +95,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.glassfish.jersey.containers</groupId>
       <artifactId>jersey-container-grizzly2-http</artifactId>
     </dependency>
diff --git a/pinot-controller/src/test/resources/log4j.properties b/pinot-controller/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-controller/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-controller/src/test/resources/log4j2.xml b/pinot-controller/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-controller/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-core/pom.xml b/pinot-core/pom.xml
index 0810ec9..eb6fd83 100644
--- a/pinot-core/pom.xml
+++ b/pinot-core/pom.xml
@@ -135,10 +135,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-csv</artifactId>
     </dependency>
diff --git a/pinot-core/src/test/resources/log4j.properties b/pinot-core/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-core/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-core/src/test/resources/log4j2.xml b/pinot-core/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-core/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-integration-tests/src/test/resources/log4j.properties b/pinot-integration-tests/src/test/resources/log4j.properties
deleted file mode 100644
index ca6440f..0000000
--- a/pinot-integration-tests/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p %c{1} [%x] - %m%n
diff --git a/pinot-integration-tests/src/test/resources/log4j2.xml b/pinot-integration-tests/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..049b8fd
--- /dev/null
+++ b/pinot-integration-tests/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-minion/src/test/resources/log4j.properties b/pinot-minion/src/test/resources/log4j.properties
deleted file mode 100644
index 90083a8..0000000
--- a/pinot-minion/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-log4j.rootLogger=WARN, stdout
-log4j.logger.org.apache.pinot=WARN
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%c{1} - %m%n
diff --git a/pinot-minion/src/test/resources/log4j2.xml b/pinot-minion/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..353a551
--- /dev/null
+++ b/pinot-minion/src/test/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%c{1} - %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="warn" additivity="false">
+      <AppenderRef ref="console" />
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/pinot-perf/pom.xml b/pinot-perf/pom.xml
index b445513..7a69487 100644
--- a/pinot-perf/pom.xml
+++ b/pinot-perf/pom.xml
@@ -188,7 +188,7 @@
           <includeConfigurationDirectoryInClasspath>false</includeConfigurationDirectoryInClasspath>
           <assembleDirectory>${project.build.directory}/${project.artifactId}-pkg</assembleDirectory>
           <!-- Extra JVM arguments that will be included in the bin scripts -->
-          <extraJvmArguments>-Xms24G -Xmx24G -Dlog4j.configuration=log4j.properties</extraJvmArguments>
+          <extraJvmArguments>-Xms24G -Xmx24G -Dlog4j2.configurationFile=log4j2.xml</extraJvmArguments>
           <!-- Generate bin scripts for windows and unix pr default -->
           <platforms>
             <platform>unix</platform>
diff --git a/pinot-perf/src/main/resources/log4j.properties b/pinot-perf/src/main/resources/log4j.properties
deleted file mode 100644
index 0b6dcde..0000000
--- a/pinot-perf/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, stdout
-log4j.logger.org.apache.pinot=INFO
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.perf=INFO, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-log4j.additivity.org.apache.pinot.perf = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
diff --git a/pinot-perf/src/main/resources/log4j2.xml b/pinot-perf/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..9c05c33
--- /dev/null
+++ b/pinot-perf/src/main/resources/log4j2.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="error" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+    <AsyncLogger name="org.apache.pinot" level="info" additivity="false"/>
+    <AsyncLogger name="org.apache.pinot.perf" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+
+    <!-- Direct controller package log to the controller log file -->
+    <AsyncLogger name="org.apache.pinot.controller" level="info" additivity="false">
+      <AppenderRef ref="controllerLog"/>
+    </AsyncLogger>
+
+    <!-- Direct broker package log to the broker log file -->
+    <AsyncLogger name="org.apache.pinot.broker" level="info" additivity="false">
+      <AppenderRef ref="brokerLog"/>
+    </AsyncLogger>
+
+    <!-- Including server related package log to the server log file -->
+    <AsyncLogger name="org.apache.pinot.server" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.plan" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.realtime" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.query" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/pom.xml b/pinot-tools/pom.xml
index 11b1b3a..2d161d9 100644
--- a/pinot-tools/pom.xml
+++ b/pinot-tools/pom.xml
@@ -79,6 +79,10 @@
       <groupId>org.yaml</groupId>
       <artifactId>snakeyaml</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
@@ -94,7 +98,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -106,7 +110,7 @@
                 <maxMemorySize>4G</maxMemorySize>
                 <extraArguments>
                   <extraArgument>-XX:MaxDirectMemorySize=30g</extraArgument>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-admin-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-admin-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -118,7 +122,7 @@
                 <maxMemorySize>20G</maxMemorySize>
                 <extraArguments>
                   <extraArgument>-XX:MaxDirectMemorySize=30g</extraArgument>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -130,7 +134,7 @@
                 <maxMemorySize>30G</maxMemorySize>
                 <extraArguments>
                   <extraArgument>-XX:MaxDirectMemorySize=30g</extraArgument>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -142,7 +146,7 @@
                 <maxMemorySize>30G</maxMemorySize>
                 <extraArguments>
                   <extraArgument>-XX:MaxDirectMemorySize=30g</extraArgument>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -153,7 +157,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -164,7 +168,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-tools-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-tools-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -175,7 +179,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-controller-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-controller-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -186,7 +190,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-broker-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-broker-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -197,7 +201,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/pinot-server-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/pinot-server-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -208,7 +212,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/quickstart-offline-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/quickstart-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -220,7 +224,7 @@
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
                   <extraArgument>-XX:MaxDirectMemorySize=6g</extraArgument>
-                  <extraArgument>-Dlog4j.configuration=conf/quickstart-offline-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/quickstart-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
@@ -231,7 +235,7 @@
                 <initialMemorySize>1G</initialMemorySize>
                 <maxMemorySize>1G</maxMemorySize>
                 <extraArguments>
-                  <extraArgument>-Dlog4j.configuration=conf/quickstart-realtime-log4j.properties</extraArgument>
+                  <extraArgument>-Dlog4j2.configurationFile=$BASEDIR/conf/quickstart-log4j2.xml</extraArgument>
                 </extraArguments>
               </jvmSettings>
             </program>
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/HybridQuickstart.java b/pinot-tools/src/main/java/org/apache/pinot/tools/HybridQuickstart.java
index beeea34..5328f9c 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/HybridQuickstart.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/HybridQuickstart.java
@@ -166,7 +166,6 @@ public class HybridQuickstart {
 
   public static void main(String[] args)
       throws Exception {
-    Quickstart.logOnlyErrors();
     new HybridQuickstart().execute();
   }
 }
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java b/pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java
index e270896..ea50eeb 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java
@@ -23,11 +23,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import java.io.File;
 import java.net.URL;
-import java.util.Enumeration;
 import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Category;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
 import org.apache.pinot.core.data.readers.FileFormat;
 import org.apache.pinot.tools.admin.command.QuickstartRunner;
 
@@ -118,16 +114,6 @@ public class Quickstart {
     return responseBuilder.toString();
   }
 
-  public static void logOnlyErrors() {
-    Logger root = Logger.getRootLogger();
-    root.setLevel(Level.ERROR);
-    Enumeration allLoggers = root.getLoggerRepository().getCurrentCategories();
-    while (allLoggers.hasMoreElements()) {
-      Category tmpLogger = (Category) allLoggers.nextElement();
-      tmpLogger.setLevel(Level.ERROR);
-    }
-  }
-
   public void execute()
       throws Exception {
     final File quickStartDataDir = new File("quickStartData" + System.currentTimeMillis());
@@ -220,7 +206,6 @@ public class Quickstart {
 
   public static void main(String[] args)
       throws Exception {
-    logOnlyErrors();
     new Quickstart().execute();
   }
 }
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/RealtimeQuickStart.java b/pinot-tools/src/main/java/org/apache/pinot/tools/RealtimeQuickStart.java
index fdf9c7c..aaea53b 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/RealtimeQuickStart.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/RealtimeQuickStart.java
@@ -133,7 +133,6 @@ public class RealtimeQuickStart {
 
   public static void main(String[] args)
       throws Exception {
-    Quickstart.logOnlyErrors();
     new RealtimeQuickStart().execute();
   }
 }
diff --git a/pinot-tools/src/main/resources/conf/pinot-admin-log4j.properties b/pinot-tools/src/main/resources/conf/pinot-admin-log4j.properties
deleted file mode 100644
index 833c2d0..0000000
--- a/pinot-tools/src/main/resources/conf/pinot-admin-log4j.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, stdout
-log4j.logger.org.apache.pinot=INFO
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools.admin=INFO, stdout
-log4j.additivity.org.apache.pinot.tools.admin = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
diff --git a/pinot-tools/src/main/resources/conf/pinot-admin-log4j2.xml b/pinot-tools/src/main/resources/conf/pinot-admin-log4j2.xml
new file mode 100644
index 0000000..c254c7b
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/pinot-admin-log4j2.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+    </Console>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+    <AsyncLogger name="org.apache.pinot.controller.ControllerStarter" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.tools.admin" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/pinot-broker-log4j.properties b/pinot-tools/src/main/resources/conf/pinot-broker-log4j.properties
deleted file mode 100644
index 62b5569..0000000
--- a/pinot-tools/src/main/resources/conf/pinot-broker-log4j.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, brokerLog, consoleWarn
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-# Output broker starter logs to the console
-log4j.logger.org.apache.pinot.broker.broker.helix.HelixBrokerStarter=INFO, consoleLog
-log4j.appender.consoleLog=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleLog.Target=System.out
-log4j.appender.consoleLog.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-
-# Display all warnings on the console
-log4j.appender.consoleWarn=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleWarn.Target=System.out
-log4j.appender.consoleWarn.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleWarn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-log4j.appender.consoleWarn.Threshold=WARN
diff --git a/pinot-tools/src/main/resources/conf/pinot-broker-log4j2.xml b/pinot-tools/src/main/resources/conf/pinot-broker-log4j2.xml
new file mode 100644
index 0000000..1549518
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/pinot-broker-log4j2.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <!-- Display warnings on the console -->
+      <AppenderRef ref="console" level="warn"/>
+      <!-- Direct most logs to the log file -->
+      <AppenderRef ref="brokerLog"/>
+    </AsyncRoot>
+    <!-- Output broker starter logs to the console -->
+    <AsyncLogger name="org.apache.pinot.broker.broker.helix.HelixBrokerStarter" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/pinot-controller-log4j.properties b/pinot-tools/src/main/resources/conf/pinot-controller-log4j.properties
deleted file mode 100644
index 4df8014..0000000
--- a/pinot-tools/src/main/resources/conf/pinot-controller-log4j.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, controllerLog, consoleWarn
-
-# Direct most logs to the log file
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-# Output controller starter logs to the console
-log4j.logger.org.apache.pinot.controller.ControllerStarter=INFO, consoleLog
-log4j.appender.consoleLog=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleLog.Target=System.out
-log4j.appender.consoleLog.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-
-# Display all warnings on the console
-log4j.appender.consoleWarn=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleWarn.Target=System.out
-log4j.appender.consoleWarn.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleWarn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-log4j.appender.consoleWarn.Threshold=WARN
diff --git a/pinot-tools/src/main/resources/conf/pinot-controller-log4j2.xml b/pinot-tools/src/main/resources/conf/pinot-controller-log4j2.xml
new file mode 100644
index 0000000..726410d
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/pinot-controller-log4j2.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <!-- Display warnings on the console -->
+      <AppenderRef ref="console" level="warn"/>
+      <!-- Direct most logs to the log file -->
+      <AppenderRef ref="controllerLog"/>
+    </AsyncRoot>
+    <!-- Output controller starter logs to the console -->
+    <AsyncLogger name="org.apache.pinot.controller.ControllerStarter" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/pinot-server-log4j.properties b/pinot-tools/src/main/resources/conf/pinot-server-log4j.properties
deleted file mode 100644
index 4f49f19..0000000
--- a/pinot-tools/src/main/resources/conf/pinot-server-log4j.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, serverLog, consoleWarn
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-# Output server starter logs to the console
-log4j.logger.org.apache.pinot.server.starter.helix.HelixServerStarter=INFO, consoleLog
-log4j.appender.consoleLog=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleLog.Target=System.out
-log4j.appender.consoleLog.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-
-# Display all warnings on the console
-log4j.appender.consoleWarn=org.apache.log4j.ConsoleAppender
-log4j.appender.consoleWarn.Target=System.out
-log4j.appender.consoleWarn.layout=com.jcabi.log.MulticolorLayout
-log4j.appender.consoleWarn.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %color{%-5p} %c{1} - %m%n
-log4j.appender.consoleWarn.Threshold=WARN
diff --git a/pinot-tools/src/main/resources/conf/pinot-server-log4j2.xml b/pinot-tools/src/main/resources/conf/pinot-server-log4j2.xml
new file mode 100644
index 0000000..5f2e861
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/pinot-server-log4j2.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <!-- Display warnings on the console -->
+      <AppenderRef ref="console" level="warn"/>
+      <!-- Direct most logs to the log file -->
+      <AppenderRef ref="serverLog"/>
+    </AsyncRoot>
+    <!-- Output server starter logs to the console -->
+    <AsyncLogger name="org.apache.pinot.server.starter.helix.HelixServerStarter" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/pinot-tools-log4j.properties b/pinot-tools/src/main/resources/conf/pinot-tools-log4j.properties
deleted file mode 100644
index e282ea0..0000000
--- a/pinot-tools/src/main/resources/conf/pinot-tools-log4j.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, stdout
-log4j.logger.org.apache.pinot=INFO
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools=INFO, stdout
-log4j.additivity.org.apache.pinot.tools = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-
diff --git a/pinot-tools/src/main/resources/conf/pinot-tools-log4j2.xml b/pinot-tools/src/main/resources/conf/pinot-tools-log4j2.xml
new file mode 100644
index 0000000..85f5d8b
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/pinot-tools-log4j2.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+    <AsyncLogger name="org.apache.pinot" level="info" additivity="false"/>
+    <AsyncLogger name="org.apache.pinot.tools" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+
+    <!-- Direct controller package log to the controller log file -->
+    <AsyncLogger name="org.apache.pinot.controller" level="info" additivity="false">
+      <AppenderRef ref="controllerLog"/>
+    </AsyncLogger>
+
+    <!-- Direct broker package log to the broker log file -->
+    <AsyncLogger name="org.apache.pinot.broker" level="info" additivity="false">
+      <AppenderRef ref="brokerLog"/>
+    </AsyncLogger>
+
+    <!-- Including server related package log to the server log file -->
+    <AsyncLogger name="org.apache.pinot.server" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.plan" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.realtime" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.query" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/quickstart-log4j.properties b/pinot-tools/src/main/resources/conf/quickstart-log4j.properties
deleted file mode 100644
index 99d41ec..0000000
--- a/pinot-tools/src/main/resources/conf/quickstart-log4j.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=ERROR, stdout
-log4j.logger.org.apache.pinot=ERROR
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools.admin=INFO, stdout
-log4j.additivity.org.apache.pinot.tools.admin = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-
diff --git a/pinot-tools/src/main/resources/conf/quickstart-log4j2.xml b/pinot-tools/src/main/resources/conf/quickstart-log4j2.xml
new file mode 100644
index 0000000..6a99ee2
--- /dev/null
+++ b/pinot-tools/src/main/resources/conf/quickstart-log4j2.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT"/>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="error" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+    <AsyncLogger name="org.apache.pinot" level="error" additivity="false"/>
+    <AsyncLogger name="org.apache.pinot.tools.admin" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+
+    <!-- Direct controller package log to the controller log file -->
+    <AsyncLogger name="org.apache.pinot.controller" level="info" additivity="false">
+      <AppenderRef ref="controllerLog"/>
+    </AsyncLogger>
+
+    <!-- Direct broker package log to the broker log file -->
+    <AsyncLogger name="org.apache.pinot.broker" level="info" additivity="false">
+      <AppenderRef ref="brokerLog"/>
+    </AsyncLogger>
+
+    <!-- Including server related package log to the server log file -->
+    <AsyncLogger name="org.apache.pinot.server" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.plan" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.realtime" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.query" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-tools/src/main/resources/conf/quickstart-offline-log4j.properties b/pinot-tools/src/main/resources/conf/quickstart-offline-log4j.properties
deleted file mode 100644
index 6cd3826..0000000
--- a/pinot-tools/src/main/resources/conf/quickstart-offline-log4j.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=ERROR, stdout
-log4j.logger.org.apache.pinot=ERROR
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools.admin=INFO, stdout
-log4j.additivity.org.apache.pinot.tools.admin = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
diff --git a/pinot-tools/src/main/resources/conf/quickstart-realtime-log4j.properties b/pinot-tools/src/main/resources/conf/quickstart-realtime-log4j.properties
deleted file mode 100644
index 6cd3826..0000000
--- a/pinot-tools/src/main/resources/conf/quickstart-realtime-log4j.properties
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=ERROR, stdout
-log4j.logger.org.apache.pinot=ERROR
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools.admin=INFO, stdout
-log4j.additivity.org.apache.pinot.tools.admin = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
diff --git a/pinot-tools/src/main/resources/log4j.properties b/pinot-tools/src/main/resources/log4j.properties
deleted file mode 100644
index 1bdef99..0000000
--- a/pinot-tools/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# 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 compliance
-# 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.
-#
-
-log4j.rootLogger=INFO, stdout
-log4j.logger.org.apache.pinot=INFO
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-log4j.logger.org.apache.pinot.tools=INFO, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.additivity.org.apache.pinot.tools = false
-
-log4j.logger.org.apache.pinot.controller=INFO, controllerLog
-log4j.logger.org.apache.pinot.broker=INFO, brokerLog
-log4j.logger.org.apache.pinot.server=INFO, serverLog
-
-log4j.appender.controllerLog=org.apache.log4j.FileAppender
-log4j.appender.controllerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.controllerLog.File=pinotController.log
-log4j.appender.controllerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.brokerLog=org.apache.log4j.FileAppender
-log4j.appender.brokerLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.brokerLog.File=pinotBroker.log
-log4j.appender.brokerLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-log4j.appender.serverLog=org.apache.log4j.FileAppender
-log4j.appender.serverLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.serverLog.File=pinotServer.log
-log4j.appender.serverLog.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c] [%x] %m%n
-
-
diff --git a/pinot-tools/src/main/resources/log4j2.xml b/pinot-tools/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..bd32101
--- /dev/null
+++ b/pinot-tools/src/main/resources/log4j2.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+    <RandomAccessFile name="controllerLog" fileName="pinotController.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="brokerLog" fileName="pinotBroker.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+    <RandomAccessFile name="serverLog" fileName="pinotServer.log" immediateFlush="false">
+      <PatternLayout>
+        <Pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] [%t] %m%n</Pattern>
+      </PatternLayout>
+    </RandomAccessFile>
+
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="error" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+    <AsyncLogger name="org.apache.pinot" level="info" additivity="false"/>
+    <AsyncLogger name="org.apache.pinot.tools" level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncLogger>
+
+    <!-- Direct controller package log to the controller log file -->
+    <AsyncLogger name="org.apache.pinot.controller" level="info" additivity="false">
+      <AppenderRef ref="controllerLog"/>
+    </AsyncLogger>
+
+    <!-- Direct broker package log to the broker log file -->
+    <AsyncLogger name="org.apache.pinot.broker" level="info" additivity="false">
+      <AppenderRef ref="brokerLog"/>
+    </AsyncLogger>
+
+    <!-- Including server related package log to the server log file -->
+    <AsyncLogger name="org.apache.pinot.server" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.plan" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.realtime" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+    <AsyncLogger name="org.apache.pinot.core.query" level="info" additivity="false">
+      <AppenderRef ref="serverLog"/>
+    </AsyncLogger>
+  </Loggers>
+</Configuration>
diff --git a/pinot-transport/pom.xml b/pinot-transport/pom.xml
index 67c6e2e..19eb4c3 100644
--- a/pinot-transport/pom.xml
+++ b/pinot-transport/pom.xml
@@ -55,10 +55,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
     </dependency>
diff --git a/pom.xml b/pom.xml
index 9dc5612..83ed620 100644
--- a/pom.xml
+++ b/pom.xml
@@ -132,6 +132,7 @@
     <!-- pinot-common, commons-configuration, hadoop-common, hadoop-client use commons-logging-->
     <commons-logging.version>1.2</commons-logging.version>
     <snappy-java.version>1.1.1.7</snappy-java.version>
+    <log4j.version>2.11.2</log4j.version>
 
     <!-- Sets the VM argument line used when unit tests are run. -->
     <argLine>-Xms4g -Xmx4g -XX:MaxPermSize=512m -XX:MaxDirectMemorySize=10g</argLine>
@@ -145,7 +146,7 @@
       </activation>
       <properties>
         <argLine>-Xms4g -Xmx4g -XX:MaxPermSize=512m -XX:MaxDirectMemorySize=10g
-          -Dlog4j.configuration=log4j-fatal-only.properties
+          -Dlog4j2.configurationFile=log4j2-fatal-only.xml
           -Djava.util.logging.config.file=logging-severe-only.properties
         </argLine>
       </properties>
@@ -327,6 +328,16 @@
         <groupId>com.101tec</groupId>
         <artifactId>zkclient</artifactId>
         <version>${zkclient.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>com.google.guava</groupId>
@@ -426,16 +437,6 @@
         <version>2.0.1</version>
       </dependency>
       <dependency>
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-api</artifactId>
-        <version>1.7.7</version>
-      </dependency>
-      <dependency>
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-log4j12</artifactId>
-        <version>1.7.7</version>
-      </dependency>
-      <dependency>
         <groupId>javax.validation</groupId>
         <artifactId>validation-api</artifactId>
         <version>2.0.1.Final</version>
@@ -453,12 +454,47 @@
             <groupId>org.jboss.netty</groupId>
             <artifactId>netty</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
+
+      <!-- log4j2 related dependencies -->
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>1.7.25</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-core</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-slf4j-impl</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-1.2-api</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
       <dependency>
-        <groupId>log4j</groupId>
-        <artifactId>log4j</artifactId>
-        <version>1.2.17</version>
+        <groupId>com.lmax</groupId>
+        <artifactId>disruptor</artifactId>
+        <version>3.3.4</version>
       </dependency>
       <dependency>
         <groupId>com.ning</groupId>
@@ -480,6 +516,16 @@
         <groupId>org.apache.zookeeper</groupId>
         <artifactId>zookeeper</artifactId>
         <version>3.4.11</version>
+        <exclusions>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>commons-beanutils</groupId>
@@ -544,6 +590,12 @@
         <groupId>org.apache.kafka</groupId>
         <artifactId>kafka_2.10</artifactId>
         <version>${kafka.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
 
       <!-- Hadoop  -->
@@ -568,12 +620,30 @@
             <groupId>com.sun.jersey</groupId>
             <artifactId>jersey-json</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hadoop</groupId>
         <artifactId>hadoop-minicluster</artifactId>
         <version>${hadoop.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hadoop</groupId>
@@ -596,17 +666,45 @@
             <groupId>com.sun.jersey</groupId>
             <artifactId>jersey-json</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.orc</groupId>
         <artifactId>orc-core</artifactId>
         <version>1.5.2</version>
+        <exclusions>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.orc</groupId>
         <artifactId>orc-mapreduce</artifactId>
         <version>1.5.2</version>
+        <exclusions>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.codehaus.jackson</groupId>
diff --git a/thirdeye/thirdeye-hadoop/src/main/resources/log4j2.xml b/thirdeye/thirdeye-hadoop/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..d654ce8
--- /dev/null
+++ b/thirdeye/thirdeye-hadoop/src/main/resources/log4j2.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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 compliance
+    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>
+  <Appenders>
+    <Console name="console" target="SYSTEM_OUT">
+      <PatternLayout>
+        <pattern>%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] %m%n</pattern>
+      </PatternLayout>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="info" additivity="false">
+      <AppenderRef ref="console"/>
+    </AsyncRoot>
+  </Loggers>
+</Configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org