hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [01/50] hadoop git commit: HADOOP-14289. Move log4j APIs over to slf4j in hadoop-common.
Date Mon, 26 Jun 2017 12:49:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-13345 be922ba6a -> 2b3c4b840


HADOOP-14289. Move log4j APIs over to slf4j in hadoop-common.


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

Branch: refs/heads/HADOOP-13345
Commit: e855cc4ed467d03f4f03e8b3a1ff27654b349a52
Parents: fb68980
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Fri Jun 16 13:17:10 2017 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Fri Jun 16 13:17:10 2017 +0900

----------------------------------------------------------------------
 .../org/apache/hadoop/http/HttpRequestLog.java  | 23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e855cc4e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpRequestLog.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpRequestLog.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpRequestLog.java
index a7c23b9..05573a8 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpRequestLog.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpRequestLog.java
@@ -24,16 +24,18 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogConfigurationException;
 import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Appender;
-import org.apache.log4j.Logger;
 import org.eclipse.jetty.server.NCSARequestLog;
 import org.eclipse.jetty.server.RequestLog;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * RequestLog object for use with Http
  */
 public class HttpRequestLog {
 
-  public static final Log LOG = LogFactory.getLog(HttpRequestLog.class);
+  public static final Logger LOG =
+      LoggerFactory.getLogger(HttpRequestLog.class);
   private static final HashMap<String, String> serverToComponent;
 
   static {
@@ -65,20 +67,18 @@ public class HttpRequestLog {
     }
     if (isLog4JLogger) {
       Log4JLogger httpLog4JLog = (Log4JLogger)logger;
-      Logger httpLogger = httpLog4JLog.getLogger();
+      org.apache.log4j.Logger httpLogger = httpLog4JLog.getLogger();
       Appender appender = null;
 
       try {
         appender = httpLogger.getAppender(appenderName);
       } catch (LogConfigurationException e) {
-        LOG.warn("Http request log for " + loggerName
-            + " could not be created");
+        LOG.warn("Http request log for {} could not be created", loggerName);
         throw e;
       }
 
       if (appender == null) {
-        LOG.info("Http request log for " + loggerName
-            + " is not defined");
+        LOG.info("Http request log for {} is not defined", loggerName);
         return null;
       }
 
@@ -89,14 +89,11 @@ public class HttpRequestLog {
         requestLog.setFilename(requestLogAppender.getFilename());
         requestLog.setRetainDays(requestLogAppender.getRetainDays());
         return requestLog;
-      }
-      else {
-        LOG.warn("Jetty request log for " + loggerName
-            + " was of the wrong class");
+      } else {
+        LOG.warn("Jetty request log for {} was of the wrong class", loggerName);
         return null;
       }
-    }
-    else {
+    } else {
       LOG.warn("Jetty request log can only be enabled using Log4j");
       return null;
     }


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


Mime
View raw message