You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by am...@apache.org on 2015/08/06 10:45:08 UTC

[1/2] incubator-lens git commit: LENS-666 : Move logging to logback

Repository: incubator-lens
Updated Branches:
  refs/heads/master 4d81aaf46 -> e6f585b73


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf/server/log4j.properties
----------------------------------------------------------------------
diff --git a/tools/conf/server/log4j.properties b/tools/conf/server/log4j.properties
deleted file mode 100644
index 2b04ea5..0000000
--- a/tools/conf/server/log4j.properties
+++ /dev/null
@@ -1,85 +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.
-#
-
-lensserver.root.logger=INFO, ROOT
-lensserver.request.logger=INFO, REQUEST
-lensserver.audit.logger=INFO, CONSOLE
-lensserver.querystatus.logger=INFO, CONSOLE
-
-log4j.rootLogger=${lensserver.root.logger}
-log4j.logger.org.apache.lens.server.LensServer.request=${lensserver.request.logger}
-log4j.additivity.org.apache.lens.server.LensServer.request=false
-log4j.logger.org.apache.lens.server.LensServer.audit=${lensserver.audit.logger}
-log4j.additivity.org.apache.lens.server.LensServer.audit=false
-log4j.logger.org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger=${lensserver.querystatus.logger}
-log4j.additivity.org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger=false
-log4j.logger.org.apache.lens.server.stats.event.query.QueryExecutionStatistics=DEBUG, QueryExecutionStatistics
-log4j.additivity.org.apache.lens.server.stats.event.query.QueryExecutionStatistics=false
-
-
-# CONSOLE is set to be a ConsoleAppender.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-
-# CONSOLE uses PatternLayout.
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.ROOT=org.apache.log4j.RollingFileAppender
-log4j.appender.ROOT.File=${lens.log.dir}/lensserver.log
-log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout
-log4j.appender.ROOT.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.ROOT.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.ROOT.MaxBackupIndex=20
-
-
-log4j.appender.AUDIT=org.apache.log4j.RollingFileAppender
-log4j.appender.AUDIT.File=${lens.log.dir}/lensserver-audit.log
-log4j.appender.AUDIT.layout=org.apache.log4j.PatternLayout
-log4j.appender.AUDIT.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.AUDIT.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.AUDIT.MaxBackupIndex=20
-
-log4j.appender.REQUEST=org.apache.log4j.RollingFileAppender
-log4j.appender.REQUEST.File=${lens.log.dir}/lensserver-requests.log
-log4j.appender.REQUEST.layout=org.apache.log4j.PatternLayout
-log4j.appender.REQUEST.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.REQUEST.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.REQUEST.MaxBackupIndex=20
-
-log4j.appender.STATUS=org.apache.log4j.RollingFileAppender
-log4j.appender.STATUS.File=${lens.log.dir}/lensserver-query-status.log
-log4j.appender.STATUS.layout=org.apache.log4j.PatternLayout
-log4j.appender.STATUS.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.STATUS.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.STATUS.MaxBackupIndex=20
-
-
-#Add query statistics logger with hourly rollup
-log4j.appender.QueryExecutionStatistics=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.QueryExecutionStatistics.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.QueryExecutionStatistics.File=${lens.log.dir}/query-stats.log
-log4j.appender.QueryExecutionStatistics.layout=org.apache.lens.server.stats.store.log.StatisticsLogLayout

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf/server/logback.xml
----------------------------------------------------------------------
diff --git a/tools/conf/server/logback.xml b/tools/conf/server/logback.xml
new file mode 100644
index 0000000..c27bea2
--- /dev/null
+++ b/tools/conf/server/logback.xml
@@ -0,0 +1,135 @@
+<?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>
+  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+  </appender>
+
+  <appender name="ROOT" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver-requests.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver-requests.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="STATUS" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver-query-status.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver-query-status.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="QueryExecutionStatistics" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/query-stats.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- hourly rollover -->
+      <fileNamePattern>${lens.log.dir}/query-stats.log.%d{yyyy-MM-dd-HH}</fileNamePattern>
+    </rollingPolicy>
+
+    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+      <layout class="org.apache.lens.server.stats.store.log.StatisticsLogLayout" />
+    </encoder>
+  </appender>
+
+  <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
+    <discriminator>
+      <key>queryLogId</key>
+      <defaultValue>unknown</defaultValue>
+    </discriminator>
+    <sift>
+      <appender name="FILE-${logSegregationId}" class="ch.qos.logback.core.FileAppender">
+        <file>${lens.log.dir}/${queryLogId}.log</file>
+        <append>true</append>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+          <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+        </layout>
+      </appender>
+    </sift>
+  </appender>
+
+  <logger name="org.apache.lens.server.LensServer.request" level="INFO" additivity="false">
+    <appender-ref ref="REQUEST" />
+  </logger>
+  <logger name="org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger" additivity="false"
+    level="INFO">
+    <appender-ref ref="STATUS" />
+  </logger>
+  <logger name="org.apache.lens.server.LensServer.audit" additivity="false" level="INFO">
+    <appender-ref ref="CONSOLE" />
+  </logger>
+  <logger name="org.apache.lens.server.stats.event.query.QueryExecutionStatistics" level="INFO" additivity="false">
+    <appender-ref ref="QueryExecutionStatistics" />
+  </logger>
+  <logger name="org.apache.hadoop.util.Shell" level="OFF"/>
+  <logger name="ch.qos.logback" level="WARN"/>
+
+  <root level="INFO">
+    <appender-ref ref="ROOT" />
+    <appender-ref ref="SIFT" />
+  </root>
+</configuration>
\ No newline at end of file


[2/2] incubator-lens git commit: LENS-666 : Move logging to logback

Posted by am...@apache.org.
LENS-666 : Move logging to logback


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

Branch: refs/heads/master
Commit: e6f585b73733e67ed0fddaa1cb6586ba527bc515
Parents: 4d81aaf
Author: Amareshwari Sriramadasu <am...@apache.org>
Authored: Thu Aug 6 14:12:41 2015 +0530
Committer: Amareshwari Sriramadasu <am...@apache.org>
Committed: Thu Aug 6 14:12:41 2015 +0530

----------------------------------------------------------------------
 bin-dist-files/LICENSE                          |   8 +
 bin-dist-files/NOTICE                           |   3 +
 lens-api/pom.xml                                |   4 -
 .../cli/commands/LensConnectionCommands.java    |  58 ++---
 lens-client/pom.xml                             |  18 +-
 lens-cube/pom.xml                               |   4 -
 lens-cube/src/test/resources/log4j.properties   |  36 ---
 lens-cube/src/test/resources/logback.xml        |  36 +++
 lens-dist/pom.xml                               |   4 +
 .../src/test/resources/log4j.properties         |  25 --
 lens-driver-hive/src/test/resources/logback.xml |  32 +++
 lens-driver-jdbc/pom.xml                        |   4 -
 .../src/test/resources/log4j.properties         |  25 --
 lens-query-lib/src/test/resources/logback.xml   |  32 +++
 lens-server-api/pom.xml                         |  16 ++
 lens-server/pom.xml                             |   4 -
 .../lens/server/LensServletContextListener.java |  26 --
 .../stats/event/LoggableLensStatistics.java     |   2 +-
 .../store/log/StatisticsLogFileScannerTask.java |  11 +-
 .../stats/store/log/StatisticsLogLayout.java    |  18 +-
 .../store/log/StatisticsLogRollupHandler.java   |   2 +-
 .../src/main/resources/lensserver-default.xml   |   2 +-
 .../src/main/webapp/WEB-INF/log4j.properties    |  28 ---
 lens-server/src/main/webapp/WEB-INF/web.xml     |   6 -
 .../server/healthcheck/TestHealthChecks.java    |   7 -
 .../server/stats/TestLogStatisticsStore.java    |  28 ++-
 .../stats/TestStatisticsLogFileScannerTask.java |  12 +-
 lens-server/src/test/resources/log4j.properties |  50 ----
 lens-server/src/test/resources/logback.xml      |  68 +++++
 pom.xml                                         | 247 ++++++++++++++++++-
 src/site/apt/admin/config.apt                   |   2 +-
 src/site/apt/admin/monitoring.apt               |   2 +-
 src/site/apt/lenshome/install-and-run.apt       |  10 +-
 tools/conf-pseudo-distr/client/log4j.properties |  38 ---
 tools/conf-pseudo-distr/client/logback.xml      |  54 ++++
 tools/conf-pseudo-distr/server/log4j.properties |  85 -------
 tools/conf-pseudo-distr/server/logback.xml      | 135 ++++++++++
 tools/conf/client/log4j.properties              |  38 ---
 tools/conf/client/logback.xml                   |  54 ++++
 tools/conf/server/log4j.properties              |  85 -------
 tools/conf/server/logback.xml                   | 135 ++++++++++
 41 files changed, 904 insertions(+), 550 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/bin-dist-files/LICENSE
----------------------------------------------------------------------
diff --git a/bin-dist-files/LICENSE b/bin-dist-files/LICENSE
index 5d593ad..f0e4c16 100644
--- a/bin-dist-files/LICENSE
+++ b/bin-dist-files/LICENSE
@@ -632,3 +632,11 @@ All the source code provided by AOP Alliance is Public Domain.
 For org.tukaani:xz library
 
 The Java implementation of XZ has been put into the public domain.
+
+For ch.qos.logback librabry
+
+logback-core, logback-classic are dual licensed under Eclipse Public License v1.0 and
+GNU Lesser General Public License version 2.1. Full text of the licenses is available in files LICENSE-EPL and
+LICENSE-LGPL. The licenses are also available at http://www.eclipse.org/legal/epl-v10.html and
+http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/bin-dist-files/NOTICE
----------------------------------------------------------------------
diff --git a/bin-dist-files/NOTICE b/bin-dist-files/NOTICE
index 1fbb09c..67e8da7 100644
--- a/bin-dist-files/NOTICE
+++ b/bin-dist-files/NOTICE
@@ -46,3 +46,6 @@ http://www.mchange.com/projects/c3p0/.
 
 This product includes mchange-commons-java. The details on how to obtain the library is available at
 https://github.com/swaldman/mchange-commons-java.
+
+This product includes Logback Core Module and Logback Classic Module. The details on how to obtain the library is
+available at http://www.qos.ch.

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-api/pom.xml
----------------------------------------------------------------------
diff --git a/lens-api/pom.xml b/lens-api/pom.xml
index e1b763d..7b917b3 100644
--- a/lens-api/pom.xml
+++ b/lens-api/pom.xml
@@ -58,10 +58,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.typesafe</groupId>
       <artifactId>config</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java
----------------------------------------------------------------------
diff --git a/lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java b/lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java
index c059f30..51c4baf 100644
--- a/lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java
+++ b/lens-cli/src/main/java/org/apache/lens/cli/commands/LensConnectionCommands.java
@@ -18,7 +18,7 @@
  */
 package org.apache.lens.cli.commands;
 
-import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
 
 import javax.ws.rs.ProcessingException;
@@ -28,14 +28,18 @@ import org.apache.lens.api.LensSessionHandle;
 import org.apache.lens.cli.commands.annotations.UserDocumentation;
 import org.apache.lens.client.LensClient;
 
-import org.apache.log4j.*;
-
+import org.slf4j.LoggerFactory;
 import org.springframework.shell.core.ExitShellRequest;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 import org.springframework.stereotype.Component;
 
+import ch.qos.logback.classic.*;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.*;
+
 import com.google.common.base.Joiner;
+
 import lombok.extern.slf4j.Slf4j;
 
 
@@ -213,37 +217,36 @@ public class LensConnectionCommands extends BaseLensCommand {
 
     public static Logger getRootLogger() {
       if (logger == null) {
-        logger = Logger.getRootLogger();
+        logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
       }
       return logger;
     }
 
     public static Logger getCliLogger() {
       if (cliLogger == null) {
-        cliLogger = Logger.getLogger(LensClient.CLILOGGER);
+        cliLogger = (Logger) LoggerFactory.getLogger(LensClient.CLILOGGER);
       }
       return cliLogger;
     }
 
-    public static ConsoleAppender getConsoleAppender() {
-      return getConsoleAppender(getPatternLayout());
-    }
-
-    public static ConsoleAppender getConsoleAppender(Layout layout) {
-      ConsoleAppender consoleAppender = new ConsoleAppender();
+    public static ConsoleAppender<ILoggingEvent> getConsoleAppender(PatternLayout layout, Context context) {
+      ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<ILoggingEvent>();
+      consoleAppender.setContext(context);
       consoleAppender.setLayout(layout);
-      consoleAppender.activateOptions();
+      consoleAppender.start();
       return consoleAppender;
     }
 
-    public static PatternLayout getPatternLayout() {
+    public static PatternLayout getPatternLayout(LoggerContext context) {
       String conversionPattern = "%d [%t] %F %-7p - %m%n";
-      return getPatternLayout(conversionPattern);
+      return getPatternLayout(conversionPattern, context);
     }
 
-    public static PatternLayout getPatternLayout(String conversionPattern) {
+    public static PatternLayout getPatternLayout(String conversionPattern, Context context) {
       PatternLayout layout = new PatternLayout();
-      layout.setConversionPattern(conversionPattern);
+      layout.setPattern(conversionPattern);
+      layout.setContext(context);
+      layout.start();
       return layout;
     }
 
@@ -255,35 +258,34 @@ public class LensConnectionCommands extends BaseLensCommand {
      */
     public static void addConsoleAppenderIfNotPresent(Logger logger) {
       boolean isConsoleAppenderAdded = false;
-      Layout layout = null;
-      Enumeration appenderSeries = logger.getAllAppenders();
-      while (appenderSeries.hasMoreElements()) {
-        Appender appender = (Appender) appenderSeries.nextElement();
+      PatternLayout layout = null;
+      Iterator<Appender<ILoggingEvent>> appenderSeries = logger.iteratorForAppenders();
+      while (appenderSeries.hasNext()) {
+        Appender<ILoggingEvent> appender = (Appender<ILoggingEvent>) appenderSeries.next();
         if (appender instanceof ConsoleAppender) {
           isConsoleAppenderAdded = true;
           break;
-        } else {
-          layout = appender.getLayout();
         }
       }
       if (!isConsoleAppenderAdded) {
         if (layout == null) {
-          layout = LoggerUtil.getPatternLayout();
+          layout = LoggerUtil.getPatternLayout(logger.getLoggerContext());
         }
         if (logger.getLevel() == null) {
           logger.setLevel(Level.DEBUG);
         }
-        ConsoleAppender consoleAppender = LoggerUtil.getConsoleAppender(layout);
+        ConsoleAppender<ILoggingEvent> consoleAppender = LoggerUtil.getConsoleAppender(layout,
+          logger.getLoggerContext());
         logger.addAppender(consoleAppender);
       }
     }
 
     public static void removeConsoleAppender(Logger logger) {
-      Enumeration appenderSeries = logger.getAllAppenders();
-      while (appenderSeries.hasMoreElements()) {
-        Appender appender = (Appender) appenderSeries.nextElement();
+      Iterator<Appender<ILoggingEvent>> appenderSeries = logger.iteratorForAppenders();
+      while (appenderSeries.hasNext()) {
+        Appender<ILoggingEvent> appender = (Appender<ILoggingEvent>) appenderSeries.next();
         if (appender instanceof ConsoleAppender) {
-          logger.removeAppender(appender);
+          logger.detachAppender(appender);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-client/pom.xml
----------------------------------------------------------------------
diff --git a/lens-client/pom.xml b/lens-client/pom.xml
index d83f830..c799ca9 100644
--- a/lens-client/pom.xml
+++ b/lens-client/pom.xml
@@ -96,10 +96,6 @@
       <artifactId>lombok</artifactId>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
     </dependency>
@@ -131,8 +127,20 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>log4j-over-slf4j</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
+      <artifactId>jcl-over-slf4j</artifactId>
     </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-cube/pom.xml
----------------------------------------------------------------------
diff --git a/lens-cube/pom.xml b/lens-cube/pom.xml
index 36b508a..fe10917 100644
--- a/lens-cube/pom.xml
+++ b/lens-cube/pom.xml
@@ -80,10 +80,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-cube/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/log4j.properties b/lens-cube/src/test/resources/log4j.properties
deleted file mode 100644
index deaf1e1..0000000
--- a/lens-cube/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,36 +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.
-#
-
-# Configuration for loggers
-log4j.rootLogger=INFO,TEST_LOG_FILE
-
-#log4j.logger.org.apache.lens=INFO, TEST_LOG_FILE
-#log4j.additivity.org.apache.lens=false
-
-# Configuration for appenders
-log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
-log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
-log4j.appender.STDOUT.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
-log4j.appender.STDOUT.Threshold=WARN
-
-log4j.appender.TEST_LOG_FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.TEST_LOG_FILE.File=target/test.log
-log4j.appender.TEST_LOG_FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.TEST_LOG_FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %L %x - %m%n
-log4j.appender.TEST_LOG_FILE.Threshold=INFO

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-cube/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/lens-cube/src/test/resources/logback.xml b/lens-cube/src/test/resources/logback.xml
new file mode 100644
index 0000000..c32886d
--- /dev/null
+++ b/lens-cube/src/test/resources/logback.xml
@@ -0,0 +1,36 @@
+<?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>
+  <appender name="TEST_LOG_FILE" class="ch.qos.logback.core.FileAppender">
+    <file>target/test.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %L - %m%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>INFO</level>
+    </filter>
+  </appender>
+  <root level="INFO">
+    <appender-ref ref="TEST_LOG_FILE"/>
+  </root>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-dist/pom.xml
----------------------------------------------------------------------
diff --git a/lens-dist/pom.xml b/lens-dist/pom.xml
index cea9906..6105978 100644
--- a/lens-dist/pom.xml
+++ b/lens-dist/pom.xml
@@ -102,6 +102,10 @@
           <artifactId>slf4j-log4j12</artifactId>
         </exclusion>
         <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+        <exclusion>
           <groupId>org.apache.avro</groupId>
           <artifactId>avro</artifactId>
         </exclusion>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-driver-hive/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/test/resources/log4j.properties b/lens-driver-hive/src/test/resources/log4j.properties
deleted file mode 100644
index 2c2dc45..0000000
--- a/lens-driver-hive/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,25 +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, out
-
-log4j.appender.out = org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout = org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern = %d (%t) [%p - %l] %m%n
-log4j.additivity.foo.bar.Baz=false

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-driver-hive/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/test/resources/logback.xml b/lens-driver-hive/src/test/resources/logback.xml
new file mode 100644
index 0000000..6da5fa4
--- /dev/null
+++ b/lens-driver-hive/src/test/resources/logback.xml
@@ -0,0 +1,32 @@
+<?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>
+  <appender name="out" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d (%t) [%p - %l] %m%n</pattern>
+    </encoder>
+  </appender>
+  <root level="INFO">
+    <appender-ref ref="out"/>
+  </root>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-driver-jdbc/pom.xml
----------------------------------------------------------------------
diff --git a/lens-driver-jdbc/pom.xml b/lens-driver-jdbc/pom.xml
index 2cb7f58..7b2c7a6 100644
--- a/lens-driver-jdbc/pom.xml
+++ b/lens-driver-jdbc/pom.xml
@@ -38,10 +38,6 @@
       <artifactId>lombok</artifactId>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.lens</groupId>
       <artifactId>lens-server-api</artifactId>
       <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-query-lib/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/lens-query-lib/src/test/resources/log4j.properties b/lens-query-lib/src/test/resources/log4j.properties
deleted file mode 100644
index a69d13a..0000000
--- a/lens-query-lib/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,25 +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 = DEBUG, out
-
-log4j.appender.out = org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout = org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern = %d (%t) [%p - %l] %m%n
-log4j.additivity.foo.bar.Baz=false

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-query-lib/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/lens-query-lib/src/test/resources/logback.xml b/lens-query-lib/src/test/resources/logback.xml
new file mode 100644
index 0000000..2aa685f
--- /dev/null
+++ b/lens-query-lib/src/test/resources/logback.xml
@@ -0,0 +1,32 @@
+<?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>
+  <appender name="out" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d (%t) [%p - %l] %m%n</pattern>
+    </encoder>
+  </appender>
+  <root level="DEBUG">
+    <appender-ref ref="out"/>
+  </root>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server-api/pom.xml
----------------------------------------------------------------------
diff --git a/lens-server-api/pom.xml b/lens-server-api/pom.xml
index 6822976..9cf2539 100644
--- a/lens-server-api/pom.xml
+++ b/lens-server-api/pom.xml
@@ -77,5 +77,21 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>log4j-over-slf4j</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/pom.xml
----------------------------------------------------------------------
diff --git a/lens-server/pom.xml b/lens-server/pom.xml
index 5174607..f5f82c1 100644
--- a/lens-server/pom.xml
+++ b/lens-server/pom.xml
@@ -200,10 +200,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-client</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/java/org/apache/lens/server/LensServletContextListener.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/LensServletContextListener.java b/lens-server/src/main/java/org/apache/lens/server/LensServletContextListener.java
index 0945a35..b351eb8 100644
--- a/lens-server/src/main/java/org/apache/lens/server/LensServletContextListener.java
+++ b/lens-server/src/main/java/org/apache/lens/server/LensServletContextListener.java
@@ -23,20 +23,12 @@ import javax.servlet.ServletContextListener;
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hive.service.CompositeService;
-import org.apache.log4j.BasicConfigurator;
-import org.apache.log4j.PropertyConfigurator;
-
-import lombok.extern.slf4j.Slf4j;
 
 /**
  * Initialize the webapp.
  */
-@Slf4j
 public class LensServletContextListener implements ServletContextListener {
 
-  /** The Constant LOG_PROPERTIES_FILE_KEY. */
-  public static final String LOG_PROPERTIES_FILE_KEY = "lens.server.log4j.properties";
-
   /**
    * * Notification that the web application initialization * process is starting. * All ServletContextListeners are
    * notified of context * initialization before any filter or servlet in the web * application is initialized.
@@ -45,24 +37,6 @@ public class LensServletContextListener implements ServletContextListener {
    */
   @Override
   public void contextInitialized(ServletContextEvent sce) {
-    // Initialize logging
-    try {
-      String log4jPropertyFile = sce.getServletContext().getInitParameter(LOG_PROPERTIES_FILE_KEY);
-      if (log4jPropertyFile != null && !log4jPropertyFile.isEmpty()) {
-        String basePath = sce.getServletContext().getRealPath("/");
-        System.out.println("Application BasePath:" + basePath);
-        PropertyConfigurator.configure(basePath + "/" + log4jPropertyFile);
-      } else {
-        System.err.println("WARN - Empty value for " + LOG_PROPERTIES_FILE_KEY + ", using BasicConfigurator");
-        BasicConfigurator.configure();
-      }
-    } catch (Exception exc) {
-      // Try basic configuration
-      System.err.println("WARNING - log4j property configurator gave error, falling back to basic configurator");
-      log.error("WARNING - log4j property configurator gave error, falling back to basic configurator", exc);
-      BasicConfigurator.configure();
-    }
-
     // start up all lens services
     HiveConf conf = LensServerConf.getHiveConf();
     LensServices services = LensServices.get();

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/java/org/apache/lens/server/stats/event/LoggableLensStatistics.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/stats/event/LoggableLensStatistics.java b/lens-server/src/main/java/org/apache/lens/server/stats/event/LoggableLensStatistics.java
index e8a7b0c..b219419 100644
--- a/lens-server/src/main/java/org/apache/lens/server/stats/event/LoggableLensStatistics.java
+++ b/lens-server/src/main/java/org/apache/lens/server/stats/event/LoggableLensStatistics.java
@@ -22,7 +22,7 @@ import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.metadata.Table;
 
 /**
- * Loggable Lens Statistics which is logged to a log4j file as a JSON Object.
+ * Loggable Lens Statistics which is logged to a log file as a JSON Object.
  */
 public abstract class LoggableLensStatistics extends LensStatistics {
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogFileScannerTask.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogFileScannerTask.java b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogFileScannerTask.java
index 7c9ff9e..3a732df 100644
--- a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogFileScannerTask.java
+++ b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogFileScannerTask.java
@@ -32,8 +32,11 @@ import org.apache.lens.server.api.events.LensEventService;
 import org.apache.lens.server.api.metrics.MetricsService;
 import org.apache.lens.server.model.LogSegregationContext;
 
-import org.apache.log4j.FileAppender;
-import org.apache.log4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.FileAppender;
 
 import lombok.NonNull;
 import lombok.Setter;
@@ -138,12 +141,12 @@ public class StatisticsLogFileScannerTask extends TimerTask {
       return;
     }
     String appenderName = event.substring(event.lastIndexOf(".") + 1, event.length());
-    Logger logger = Logger.getLogger(event);
+    Logger logger = (Logger) LoggerFactory.getLogger(event);
     if (logger.getAppender(appenderName) == null) {
       log.error("Unable to find statistics log appender for {}  with appender name {}", event, appenderName);
       return;
     }
-    String location = ((FileAppender) logger.getAppender(appenderName)).getFile();
+    String location = ((FileAppender<ILoggingEvent>) logger.getAppender(appenderName)).getFile();
     scanSet.put(appenderName, location);
     classSet.put(appenderName, event);
   }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogLayout.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogLayout.java b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogLayout.java
index 67a163c..300559f 100644
--- a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogLayout.java
+++ b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogLayout.java
@@ -18,21 +18,17 @@
  */
 package org.apache.lens.server.stats.store.log;
 
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.spi.LoggingEvent;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.CoreConstants;
+import ch.qos.logback.core.LayoutBase;
 
 /**
- * Empty statistics log layout for log4j.
+ * Statistics log layout.
  */
-public class StatisticsLogLayout extends SimpleLayout {
+public class StatisticsLogLayout extends LayoutBase<ILoggingEvent> {
 
-  /*
-   * (non-Javadoc)
-   *
-   * @see org.apache.log4j.SimpleLayout#format(org.apache.log4j.spi.LoggingEvent)
-   */
   @Override
-  public String format(LoggingEvent event) {
-    return event.getRenderedMessage() + LINE_SEP;
+  public String doLayout(ILoggingEvent loggingEvent) {
+    return loggingEvent.getMessage() + CoreConstants.LINE_SEPARATOR;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogRollupHandler.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogRollupHandler.java b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogRollupHandler.java
index 9ff878c..f6255ab 100644
--- a/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogRollupHandler.java
+++ b/lens-server/src/main/java/org/apache/lens/server/stats/store/log/StatisticsLogRollupHandler.java
@@ -31,7 +31,7 @@ import org.eclipse.jetty.util.ConcurrentHashSet;
 import lombok.NonNull;
 
 /**
- * Class which handles the log4j rolled file.
+ * Class which handles the rolled log file.
  */
 public class StatisticsLogRollupHandler {
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/resources/lensserver-default.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/main/resources/lensserver-default.xml b/lens-server/src/main/resources/lensserver-default.xml
index 6af8d10..5d33eda 100644
--- a/lens-server/src/main/resources/lensserver-default.xml
+++ b/lens-server/src/main/resources/lensserver-default.xml
@@ -123,7 +123,7 @@
     <name>lens.server.query.state.logger.enabled</name>
     <value>true</value>
     <description>Disable or enable the query state logger with this config.
-      The location for the logger can be specified in log4j properties for the class
+      The location for the logger can be specified in logback xml for the class
       org.apache.lens.server.query.QueryExecutionServiceImpl.QueryStatusLogger
     </description>
   </property>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/webapp/WEB-INF/log4j.properties
----------------------------------------------------------------------
diff --git a/lens-server/src/main/webapp/WEB-INF/log4j.properties b/lens-server/src/main/webapp/WEB-INF/log4j.properties
deleted file mode 100644
index f5fdffa..0000000
--- a/lens-server/src/main/webapp/WEB-INF/log4j.properties
+++ /dev/null
@@ -1,28 +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.
-#
-
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=INFO, A1
-
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/main/webapp/WEB-INF/web.xml b/lens-server/src/main/webapp/WEB-INF/web.xml
index 4ee54a6..cb3e204 100644
--- a/lens-server/src/main/webapp/WEB-INF/web.xml
+++ b/lens-server/src/main/webapp/WEB-INF/web.xml
@@ -40,12 +40,6 @@
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
-  <!-- Servlet Configuration -->
-  <context-param>
-    <param-name>lens.server.log4j.properties</param-name>
-    <param-value>WEB-INF/log4j.properties</param-value>
-  </context-param>
-
   <!-- Servlet context listener to initialize the webapp -->
   <listener>
     <listener-class>org.apache.lens.server.LensServletContextListener</listener-class>

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/test/java/org/apache/lens/server/healthcheck/TestHealthChecks.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/healthcheck/TestHealthChecks.java b/lens-server/src/test/java/org/apache/lens/server/healthcheck/TestHealthChecks.java
index 3573a1e..e11413e 100644
--- a/lens-server/src/test/java/org/apache/lens/server/healthcheck/TestHealthChecks.java
+++ b/lens-server/src/test/java/org/apache/lens/server/healthcheck/TestHealthChecks.java
@@ -35,8 +35,6 @@ import org.apache.lens.server.quota.QuotaServiceImpl;
 import org.apache.lens.server.scheduler.QuerySchedulerServiceImpl;
 import org.apache.lens.server.session.HiveSessionService;
 
-import org.apache.log4j.BasicConfigurator;
-
 import org.glassfish.jersey.client.ClientConfig;
 import org.glassfish.jersey.media.multipart.MultiPartFeature;
 
@@ -46,16 +44,11 @@ import org.testng.annotations.Test;
 
 import com.codahale.metrics.health.HealthCheck;
 
-
-import lombok.extern.slf4j.Slf4j;
-
-@Slf4j
 @Test(groups = "unit-test")
 public class TestHealthChecks extends LensJerseyTest {
   @BeforeTest
   public void setUp() throws Exception {
     super.setUp();
-    BasicConfigurator.configure();
   }
 
   @AfterTest

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/test/java/org/apache/lens/server/stats/TestLogStatisticsStore.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/stats/TestLogStatisticsStore.java b/lens-server/src/test/java/org/apache/lens/server/stats/TestLogStatisticsStore.java
index c8a0ea5..b72c933 100644
--- a/lens-server/src/test/java/org/apache/lens/server/stats/TestLogStatisticsStore.java
+++ b/lens-server/src/test/java/org/apache/lens/server/stats/TestLogStatisticsStore.java
@@ -18,7 +18,7 @@
  */
 package org.apache.lens.server.stats;
 
-import java.io.StringWriter;
+import java.io.ByteArrayOutputStream;
 
 import org.apache.lens.server.LensServerConf;
 import org.apache.lens.server.stats.event.LoggableLensStatistics;
@@ -27,12 +27,15 @@ import org.apache.lens.server.stats.store.log.StatisticsLogLayout;
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.ql.metadata.Table;
-import org.apache.log4j.Logger;
-import org.apache.log4j.WriterAppender;
 
+import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.OutputStreamAppender;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 /**
@@ -81,18 +84,23 @@ public class TestLogStatisticsStore {
     LogStatisticsStore store = new LogStatisticsStore();
     store.initialize(LensServerConf.getHiveConf());
     // Do some initialization work
-    StringWriter writer = new StringWriter();
-    Logger l = Logger.getLogger(MyLoggableLens.class);
-    WriterAppender appender = new WriterAppender(new StatisticsLogLayout(), writer);
-
-    appender.setName(MyLoggableLens.class.getSimpleName());
+    ByteArrayOutputStream writer = new ByteArrayOutputStream();
+    Logger l = (Logger) LoggerFactory.getLogger(MyLoggableLens.class);
+    OutputStreamAppender<ILoggingEvent> appender = new OutputStreamAppender<ILoggingEvent>();
+    appender.setLayout(new StatisticsLogLayout());
+    appender.setContext(l.getLoggerContext());
+    appender.setOutputStream(writer);
+    appender.setName(MyLoggableLens.class.getCanonicalName());
+    appender.start();
     l.addAppender(appender);
     MyLoggableLens sampleEvent = new MyLoggableLens(System.currentTimeMillis());
     store.process(sampleEvent);
     writer.flush();
-    l.removeAppender(appender);
+    l.detachAppender(appender);
+    appender.stop();
     ObjectMapper mapper = new ObjectMapper();
     String expected = mapper.writeValueAsString(sampleEvent);
-    Assert.assertEquals(writer.toString().trim(), expected.trim());
+    Assert.assertEquals(new String(writer.toByteArray(), "UTF-8").trim(), expected.trim());
+    writer.close();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
index 819c62a..3d1de92 100644
--- a/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
+++ b/lens-server/src/test/java/org/apache/lens/server/stats/TestStatisticsLogFileScannerTask.java
@@ -28,17 +28,19 @@ import org.apache.lens.server.model.MappedDiagnosticLogSegregationContext;
 import org.apache.lens.server.stats.store.log.PartitionEvent;
 import org.apache.lens.server.stats.store.log.StatisticsLogFileScannerTask;
 
-import org.apache.log4j.FileAppender;
-import org.apache.log4j.Logger;
-
 import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
+import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.FileAppender;
+
 import lombok.extern.slf4j.Slf4j;
 
 /**
@@ -87,8 +89,8 @@ public class TestStatisticsLogFileScannerTask {
    */
   @Test
   public void testScanner() throws Exception {
-    Logger l = Logger.getLogger(TestStatisticsLogFileScannerTask.class);
-    FileAppender appender = new FileAppender();
+    Logger l = (Logger) LoggerFactory.getLogger(TestStatisticsLogFileScannerTask.class);
+    FileAppender<ILoggingEvent> appender = new FileAppender<ILoggingEvent>();
     String logFile = f.getParent() + File.separator + "test.log";
     appender.setFile(logFile);
     appender.setName(TestStatisticsLogFileScannerTask.class.getSimpleName());

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/lens-server/src/test/resources/log4j.properties b/lens-server/src/test/resources/log4j.properties
deleted file mode 100644
index 9cc1e36..0000000
--- a/lens-server/src/test/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.
-#
-
-# Configuration for loggers
-log4j.rootLogger=INFO, STDOUT, TEST_LOG_FILE
-
-log4j.logger.org.apache.lens=INFO, STDOUT, TEST_LOG_FILE
-log4j.additivity.org.apache.lens=false
-
-# org.apache.lens.server.stats.TestLogStatisticsStore$MyLoggableLens logger has to run at INFO level for
-# testLogStatisticsStore test case
-log4j.logger.org.apache.lens.server.stats.TestLogStatisticsStore$MyLoggableLens=INFO, STDOUT, TEST_LOG_FILE
-log4j.additivity.org.apache.lens.server.stats.TestLogStatisticsStore$MyLoggableLens=false
-
-log4j.logger.org.apache.lens.server.TestLogResource=INFO, STDOUT, TEST_LOG_RESOURCE
-log4j.additivity.org.apache.lens.server.TestLogResource=true
-
-# Configuration for appenders
-log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
-log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
-log4j.appender.STDOUT.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-log4j.appender.STDOUT.Threshold=ERROR
-
-log4j.appender.TEST_LOG_FILE=org.apache.log4j.RollingFileAppender
-log4j.appender.TEST_LOG_FILE.File=target/test.log
-log4j.appender.TEST_LOG_FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.TEST_LOG_FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %X{logSegregationId} [%t] %-5p %c %x - %m%n
-log4j.appender.TEST_LOG_FILE.Threshold=INFO
-
-log4j.appender.TEST_LOG_RESOURCE=org.apache.log4j.RollingFileAppender
-log4j.appender.TEST_LOG_RESOURCE.File=target/logresource.log
-log4j.appender.TEST_LOG_RESOURCE.layout=org.apache.log4j.PatternLayout
-log4j.appender.TEST_LOG_RESOURCE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %X{logSegregationId} [%t] %-5p %c %x - %m%n
-log4j.appender.TEST_LOG_RESOURCE.Threshold=INFO

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/lens-server/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/lens-server/src/test/resources/logback.xml b/lens-server/src/test/resources/logback.xml
new file mode 100644
index 0000000..a345054
--- /dev/null
+++ b/lens-server/src/test/resources/logback.xml
@@ -0,0 +1,68 @@
+<?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>
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>ERROR</level>
+    </filter>
+  </appender>
+  <appender name="TEST_LOG_FILE" class="ch.qos.logback.core.FileAppender">
+    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
+    <file>target/test.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} %X{logSegregationId} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>INFO</level>
+    </filter>
+  </appender>
+  <appender name="TEST_LOG_RESOURCE" class="ch.qos.logback.core.FileAppender">
+    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
+    <file>target/logresource.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} %X{logSegregationId} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>INFO</level>
+    </filter>
+  </appender>
+  <logger name="org.apache.lens.server.stats.TestLogStatisticsStore$MyLoggableLens" additivity="false" level="INFO">
+    <appender-ref ref="STDOUT"/>
+    <appender-ref ref="TEST_LOG_FILE"/>
+  </logger>
+  <logger name="org.apache.lens.server.TestLogResource" level="INFO">
+    <appender-ref ref="STDOUT"/>
+    <appender-ref ref="TEST_LOG_RESOURCE"/>
+  </logger>
+  <logger name="org.apache.lens" additivity="false" level="INFO">
+    <appender-ref ref="STDOUT"/>
+    <appender-ref ref="TEST_LOG_FILE"/>
+  </logger>
+  <root level="INFO">
+    <appender-ref ref="STDOUT"/>
+    <appender-ref ref="TEST_LOG_FILE"/>
+  </root>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2881815..71c3e78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,7 +55,6 @@
 
     <!-- common library/framework versions -->
     <slf4j.version>1.7.6</slf4j.version>
-    <log4j.version>1.2.16</log4j.version>
     <commons.lang.version>2.4</commons.lang.version>
     <commons.collections.version>3.2.1</commons.collections.version>
     <joda.time.version>2.0</joda.time.version>
@@ -63,6 +62,7 @@
     <lombok.version>1.12.4</lombok.version>
     <lombok.maven.plugin.version>1.16.4.1</lombok.maven.plugin.version>
     <typesafe.config.version>1.2.1</typesafe.config.version>
+    <logback.version>1.1.3</logback.version>
 
     <jackson.asl.version>1.9.13</jackson.asl.version>
     <jackson.guava.version>2.3.3</jackson.guava.version>
@@ -744,13 +744,23 @@
       </dependency>
       <dependency>
         <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-log4j12</artifactId>
+        <artifactId>log4j-over-slf4j</artifactId>
         <version>${slf4j.version}</version>
       </dependency>
       <dependency>
-        <groupId>log4j</groupId>
-        <artifactId>log4j</artifactId>
-        <version>${log4j.version}</version>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jcl-over-slf4j</artifactId>
+        <version>${slf4j.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>ch.qos.logback</groupId>
+        <artifactId>logback-classic</artifactId>
+        <version>${logback.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>ch.qos.logback</groupId>
+        <artifactId>logback-core</artifactId>
+        <version>${logback.version}</version>
       </dependency>
       <dependency>
         <groupId>commons-lang</groupId>
@@ -827,6 +837,10 @@
             <artifactId>slf4j-log4j12</artifactId>
           </exclusion>
           <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
             <groupId>org.apache.avro</groupId>
             <artifactId>avro</artifactId>
           </exclusion>
@@ -911,6 +925,10 @@
             <artifactId>slf4j-log4j12</artifactId>
           </exclusion>
           <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
             <groupId>org.apache.avro</groupId>
             <artifactId>avro</artifactId>
           </exclusion>
@@ -937,12 +955,48 @@
         <artifactId>hive-service</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-serde</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>com.typesafe</groupId>
@@ -961,6 +1015,18 @@
         <scope>provided</scope>
         <exclusions>
           <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging-api</artifactId>
           </exclusion>
@@ -968,6 +1034,10 @@
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>org.mortbay.jetty</groupId>
+            <artifactId>jetty</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
@@ -975,24 +1045,96 @@
         <artifactId>hive-metastore</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-common</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-exec</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.hive</groupId>
         <artifactId>hive-cli</artifactId>
         <version>${hive.version}</version>
         <scope>provided</scope>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
 
       <dependency>
@@ -1172,6 +1314,12 @@
         <groupId>org.springframework.shell</groupId>
         <artifactId>spring-shell</artifactId>
         <version>${spring.shell.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <!-- HSQLDB Dependency for examples to work -->
       <dependency>
@@ -1212,23 +1360,92 @@
             <artifactId>jline</artifactId>
             <groupId>jline</groupId>
           </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jul-to-slf4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.spark</groupId>
         <artifactId>spark-mllib_2.10</artifactId>
         <version>${spark.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jul-to-slf4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.spark</groupId>
         <artifactId>spark-yarn_2.10</artifactId>
         <version>${spark.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jul-to-slf4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
-
       <dependency>
         <groupId>org.apache.hive.hcatalog</groupId>
         <artifactId>hive-hcatalog-core</artifactId>
         <version>${hive.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.apache.thrift</groupId>
@@ -1245,33 +1462,39 @@
         <artifactId>jsch</artifactId>
         <version>${jsch.version}</version>
       </dependency>
-
       <!-- jest elastic search deps -->
       <dependency>
         <groupId>io.searchbox</groupId>
         <artifactId>jest</artifactId>
         <version>${jest.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
-
       <dependency>
         <groupId>com.fasterxml.jackson.datatype</groupId>
         <artifactId>jackson-datatype-guava</artifactId>
         <version>${jackson.guava.version}</version>
       </dependency>
-
       <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpclient</artifactId>
         <version>${httpclient.version}</version>
+        <exclusions>
+          <exclusion>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
-
       <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpcore</artifactId>
         <version>${httpcore.version}</version>
       </dependency>
-
-
     </dependencies>
   </dependencyManagement>
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/src/site/apt/admin/config.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/admin/config.apt b/src/site/apt/admin/config.apt
index 2e1dbe7..b163a3a 100644
--- a/src/site/apt/admin/config.apt
+++ b/src/site/apt/admin/config.apt
@@ -135,7 +135,7 @@ Lens server configuration
 *--+--+---+--+
 |53|lens.server.query.service.impl|org.apache.lens.server.query.QueryExecutionServiceImpl|Implementation class for query execution service|
 *--+--+---+--+
-|54|lens.server.query.state.logger.enabled|true|Disable or enable the query state logger with this config. The location for the logger can be specified in log4j properties for the class org.apache.lens.server.query.QueryExecutionServiceImpl.QueryStatusLogger|
+|54|lens.server.query.state.logger.enabled|true|Disable or enable the query state logger with this config. The location for the logger can be specified in logback xml for the class org.apache.lens.server.query.QueryExecutionServiceImpl.QueryStatusLogger|
 *--+--+---+--+
 |55|lens.server.query.ws.resource.impl|org.apache.lens.server.query.QueryServiceResource|Implementation class for Query Resource|
 *--+--+---+--+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/src/site/apt/admin/monitoring.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/admin/monitoring.apt b/src/site/apt/admin/monitoring.apt
index 3ad2f92..9429394 100644
--- a/src/site/apt/admin/monitoring.apt
+++ b/src/site/apt/admin/monitoring.apt
@@ -119,5 +119,5 @@ Lens server monitoring
 
 * Query Statistics:
 
-  Lens Server can be configured to emit query related statistics to a hive table <QueryExecutionStatistics>.The statistics service can be configured by providing values to <lens.statistics.warehouse.dir> set to a HDFS location where your query statistics log file will be persisted, <lens.statistics.db> the database which will contain all statistics related tables and <lens.log.rollover.interval> time interval which service will be monitoring for rollover in log file.The statistics can be disabled by setting, <lens.server.statistics.store.class> to empty string. The statistics service works by monitoring for rollups of <query-stats.log> file by log4j and adds an appropriate partition based on the rolled over file. The statistics can be queried using Hive queries.
+  Lens Server can be configured to emit query related statistics to a hive table <QueryExecutionStatistics>.The statistics service can be configured by providing values to <lens.statistics.warehouse.dir> set to a HDFS location where your query statistics log file will be persisted, <lens.statistics.db> the database which will contain all statistics related tables and <lens.log.rollover.interval> time interval which service will be monitoring for rollover in log file.The statistics can be disabled by setting, <lens.server.statistics.store.class> to empty string. The statistics service works by monitoring for rollups of <query-stats.log> file and adds an appropriate partition based on the rolled over file. The statistics can be queried using Hive queries.
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/src/site/apt/lenshome/install-and-run.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/lenshome/install-and-run.apt b/src/site/apt/lenshome/install-and-run.apt
index 8016491..0c55c5a 100644
--- a/src/site/apt/lenshome/install-and-run.apt
+++ b/src/site/apt/lenshome/install-and-run.apt
@@ -103,13 +103,13 @@ Installing and Running Lens
   │   ├── jdbcdriver-site.xml
   │   ├── lens-env.sh
   │   ├── lens-site.xml
-  │   └── log4j.properties
+  │   └── logback.xml
   ├── conf-pseudo-distr
   │   ├── hivedriver-site.xml
   │   ├── jdbcdriver-site.xml
   │   ├── lens-env.sh
   │   ├── lens-site.xml
-  │   └── log4j.properties
+  │   └── logback.xml
   └── webapp
       └── lens-server.war
 +---+
@@ -120,7 +120,7 @@ Installing and Running Lens
 
   Server configuration can be overridden in lens-site.xml. See {{{../admin/config.html}server configuration}} for all the configuration parameters available and their default values. You can set up the environment variables such as JAVA_HOME, java options, heap size and etc in lens-env.sh.
 
-  The server logs go into logs/ folder in the <lens-install-dir> directory, unless overridden. The proper logging configuration can be provided in log4j.properties file.
+  The server logs go into logs/ folder in the <lens-install-dir> directory, unless overridden. The proper logging configuration can be provided in logback.xml file.
 
 *** Driver configuration
 
@@ -170,7 +170,7 @@ Installing and Running Lens
   ├── conf
   │   ├── lens-client-site.xml
   │   ├── lens-env.sh
-  │   └── log4j.properties
+  │   └── logback.xml
   ├── examples
   │   ├── data
   │   │   ├── dim1_local
@@ -212,7 +212,7 @@ Installing and Running Lens
 
   Client configuration can be overridden in lens-client-site.xml. See {{{../user/client-config.html}client configuration}} for all the configuration parameters available and their default values. You can set up the environment variables such as JAVA_HOME, java options, heap size and etc in lens-env.sh.
 
-  The client logs go into logs/ folder in the install directory, unless overridden. The proper logging configuration can be provided in log4j.properties file.
+  The client logs go into logs/ folder in the install directory, unless overridden. The proper logging configuration can be provided in logback.xml file.
 
   Examples folder contains sample resource files, data files and query files which will be used by <<run-examples.sh>> script.
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf-pseudo-distr/client/log4j.properties
----------------------------------------------------------------------
diff --git a/tools/conf-pseudo-distr/client/log4j.properties b/tools/conf-pseudo-distr/client/log4j.properties
deleted file mode 100644
index 3756cf7..0000000
--- a/tools/conf-pseudo-distr/client/log4j.properties
+++ /dev/null
@@ -1,38 +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.
-#
-
-
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=INFO, root
-
-log4j.category.org.springframework=OFF
-
-log4j.appender.root=org.apache.log4j.RollingFileAppender
-log4j.appender.root.File=${lens.log.dir}/lensclient.log
-log4j.appender.root.layout=org.apache.log4j.PatternLayout
-log4j.appender.root.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n
-log4j.appender.root.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.root.MaxBackupIndex=20
-
-log4j.category.cliLogger=DEBUG, verboseLogger
-log4j.appender.verboseLogger=org.apache.log4j.ConsoleAppender
-log4j.appender.verboseLogger.layout=org.apache.log4j.PatternLayout
-log4j.appender.verboseLogger.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n
-log4j.additivity.cliLogger=false

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf-pseudo-distr/client/logback.xml
----------------------------------------------------------------------
diff --git a/tools/conf-pseudo-distr/client/logback.xml b/tools/conf-pseudo-distr/client/logback.xml
new file mode 100644
index 0000000..d142348
--- /dev/null
+++ b/tools/conf-pseudo-distr/client/logback.xml
@@ -0,0 +1,54 @@
+<?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>
+  <appender name="verboseLogger" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+  </appender>
+  <appender name="root" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
+    <file>${lens.log.dir}/lensclient.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensclient.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <MaxFileSize>100MB</MaxFileSize>
+    </triggeringPolicy>
+  </appender>
+  <logger name="org.springframework" level="OFF"/>
+  <logger name="ch.qos.logback" level="WARN"/>
+  <logger name="cliLogger" additivity="false" level="DEBUG">
+    <appender-ref ref="verboseLogger"/>
+  </logger>
+  <root level="INFO">
+    <appender-ref ref="root"/>
+  </root>
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf-pseudo-distr/server/log4j.properties
----------------------------------------------------------------------
diff --git a/tools/conf-pseudo-distr/server/log4j.properties b/tools/conf-pseudo-distr/server/log4j.properties
deleted file mode 100644
index 2b04ea5..0000000
--- a/tools/conf-pseudo-distr/server/log4j.properties
+++ /dev/null
@@ -1,85 +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.
-#
-
-lensserver.root.logger=INFO, ROOT
-lensserver.request.logger=INFO, REQUEST
-lensserver.audit.logger=INFO, CONSOLE
-lensserver.querystatus.logger=INFO, CONSOLE
-
-log4j.rootLogger=${lensserver.root.logger}
-log4j.logger.org.apache.lens.server.LensServer.request=${lensserver.request.logger}
-log4j.additivity.org.apache.lens.server.LensServer.request=false
-log4j.logger.org.apache.lens.server.LensServer.audit=${lensserver.audit.logger}
-log4j.additivity.org.apache.lens.server.LensServer.audit=false
-log4j.logger.org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger=${lensserver.querystatus.logger}
-log4j.additivity.org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger=false
-log4j.logger.org.apache.lens.server.stats.event.query.QueryExecutionStatistics=DEBUG, QueryExecutionStatistics
-log4j.additivity.org.apache.lens.server.stats.event.query.QueryExecutionStatistics=false
-
-
-# CONSOLE is set to be a ConsoleAppender.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-
-# CONSOLE uses PatternLayout.
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.ROOT=org.apache.log4j.RollingFileAppender
-log4j.appender.ROOT.File=${lens.log.dir}/lensserver.log
-log4j.appender.ROOT.layout=org.apache.log4j.PatternLayout
-log4j.appender.ROOT.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.ROOT.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.ROOT.MaxBackupIndex=20
-
-
-log4j.appender.AUDIT=org.apache.log4j.RollingFileAppender
-log4j.appender.AUDIT.File=${lens.log.dir}/lensserver-audit.log
-log4j.appender.AUDIT.layout=org.apache.log4j.PatternLayout
-log4j.appender.AUDIT.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.AUDIT.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.AUDIT.MaxBackupIndex=20
-
-log4j.appender.REQUEST=org.apache.log4j.RollingFileAppender
-log4j.appender.REQUEST.File=${lens.log.dir}/lensserver-requests.log
-log4j.appender.REQUEST.layout=org.apache.log4j.PatternLayout
-log4j.appender.REQUEST.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.REQUEST.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.REQUEST.MaxBackupIndex=20
-
-log4j.appender.STATUS=org.apache.log4j.RollingFileAppender
-log4j.appender.STATUS.File=${lens.log.dir}/lensserver-query-status.log
-log4j.appender.STATUS.layout=org.apache.log4j.PatternLayout
-log4j.appender.STATUS.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c %x - %m%n
-
-log4j.appender.STATUS.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.STATUS.MaxBackupIndex=20
-
-
-#Add query statistics logger with hourly rollup
-log4j.appender.QueryExecutionStatistics=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.QueryExecutionStatistics.DatePattern='.'yyyy-MM-dd-HH
-log4j.appender.QueryExecutionStatistics.File=${lens.log.dir}/query-stats.log
-log4j.appender.QueryExecutionStatistics.layout=org.apache.lens.server.stats.store.log.StatisticsLogLayout

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf-pseudo-distr/server/logback.xml
----------------------------------------------------------------------
diff --git a/tools/conf-pseudo-distr/server/logback.xml b/tools/conf-pseudo-distr/server/logback.xml
new file mode 100644
index 0000000..c27bea2
--- /dev/null
+++ b/tools/conf-pseudo-distr/server/logback.xml
@@ -0,0 +1,135 @@
+<?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>
+  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+  </appender>
+
+  <appender name="ROOT" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver-requests.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver-requests.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="STATUS" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/lensserver-query-status.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensserver-query-status.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+  <appender name="QueryExecutionStatistics" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${lens.log.dir}/query-stats.log</file>
+    <append>true</append>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- hourly rollover -->
+      <fileNamePattern>${lens.log.dir}/query-stats.log.%d{yyyy-MM-dd-HH}</fileNamePattern>
+    </rollingPolicy>
+
+    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+      <layout class="org.apache.lens.server.stats.store.log.StatisticsLogLayout" />
+    </encoder>
+  </appender>
+
+  <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
+    <discriminator>
+      <key>queryLogId</key>
+      <defaultValue>unknown</defaultValue>
+    </discriminator>
+    <sift>
+      <appender name="FILE-${logSegregationId}" class="ch.qos.logback.core.FileAppender">
+        <file>${lens.log.dir}/${queryLogId}.log</file>
+        <append>true</append>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+          <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%X{logSegregationId}] [%t] %-5p %c - %m%n</pattern>
+        </layout>
+      </appender>
+    </sift>
+  </appender>
+
+  <logger name="org.apache.lens.server.LensServer.request" level="INFO" additivity="false">
+    <appender-ref ref="REQUEST" />
+  </logger>
+  <logger name="org.apache.lens.server.query.QueryExecutionServiceImpl$QueryStatusLogger" additivity="false"
+    level="INFO">
+    <appender-ref ref="STATUS" />
+  </logger>
+  <logger name="org.apache.lens.server.LensServer.audit" additivity="false" level="INFO">
+    <appender-ref ref="CONSOLE" />
+  </logger>
+  <logger name="org.apache.lens.server.stats.event.query.QueryExecutionStatistics" level="INFO" additivity="false">
+    <appender-ref ref="QueryExecutionStatistics" />
+  </logger>
+  <logger name="org.apache.hadoop.util.Shell" level="OFF"/>
+  <logger name="ch.qos.logback" level="WARN"/>
+
+  <root level="INFO">
+    <appender-ref ref="ROOT" />
+    <appender-ref ref="SIFT" />
+  </root>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf/client/log4j.properties
----------------------------------------------------------------------
diff --git a/tools/conf/client/log4j.properties b/tools/conf/client/log4j.properties
deleted file mode 100644
index 3756cf7..0000000
--- a/tools/conf/client/log4j.properties
+++ /dev/null
@@ -1,38 +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.
-#
-
-
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=INFO, root
-
-log4j.category.org.springframework=OFF
-
-log4j.appender.root=org.apache.log4j.RollingFileAppender
-log4j.appender.root.File=${lens.log.dir}/lensclient.log
-log4j.appender.root.layout=org.apache.log4j.PatternLayout
-log4j.appender.root.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n
-log4j.appender.root.MaxFileSize=100000KB
-# Keep 20 backup files
-log4j.appender.root.MaxBackupIndex=20
-
-log4j.category.cliLogger=DEBUG, verboseLogger
-log4j.appender.verboseLogger=org.apache.log4j.ConsoleAppender
-log4j.appender.verboseLogger.layout=org.apache.log4j.PatternLayout
-log4j.appender.verboseLogger.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n
-log4j.additivity.cliLogger=false

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/e6f585b7/tools/conf/client/logback.xml
----------------------------------------------------------------------
diff --git a/tools/conf/client/logback.xml b/tools/conf/client/logback.xml
new file mode 100644
index 0000000..d142348
--- /dev/null
+++ b/tools/conf/client/logback.xml
@@ -0,0 +1,54 @@
+<?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>
+  <appender name="verboseLogger" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+  </appender>
+  <appender name="root" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
+    <file>${lens.log.dir}/lensclient.log</file>
+    <encoder>
+      <pattern>%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p %c - %m%n</pattern>
+    </encoder>
+    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+      <!-- daily rollover -->
+      <fileNamePattern>${lens.log.dir}/lensclient.log.%d{yyyy-MM-dd}</fileNamePattern>
+
+      <!-- keep 30 days' worth of history -->
+      <maxHistory>30</maxHistory>
+    </rollingPolicy>
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <MaxFileSize>100MB</MaxFileSize>
+    </triggeringPolicy>
+  </appender>
+  <logger name="org.springframework" level="OFF"/>
+  <logger name="ch.qos.logback" level="WARN"/>
+  <logger name="cliLogger" additivity="false" level="DEBUG">
+    <appender-ref ref="verboseLogger"/>
+  </logger>
+  <root level="INFO">
+    <appender-ref ref="root"/>
+  </root>
+</configuration>
+