[
https://issues.apache.org/jira/browse/HADOOP-18206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17680747#comment-17680747
]
ASF GitHub Bot commented on HADOOP-18206:
-----------------------------------------
jojochuang commented on code in PR #5315:
URL: https://github.com/apache/hadoop/pull/5315#discussion_r1087030863
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:
##########
@@ -360,7 +358,8 @@ public class DataNode extends ReconfigurableBase
FS_GETSPACEUSED_JITTER_KEY,
FS_GETSPACEUSED_CLASSNAME));
- public static final Log METRICS_LOG =
LogFactory.getLog("DataNodeMetricsLog");
+ public static final org.apache.log4j.Logger METRICS_LOG =
+ org.apache.log4j.Logger.getLogger("DataNodeMetricsLog");
Review Comment:
We should avoid using log4j directly. The proper usage is to use slf4j
Logger, and it will then indirectly use log4j. In fact ideally we don't even
need to declare direct dependency on log4. Certain logger usage in Hadoop
forces us to use log4j APIs but in generally that's discouraged.
I don't mind making the follow up change later. This PR is already huge and
take too much time to iterate.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/LogAdapter.java:
##########
@@ -17,62 +17,34 @@
*/
package org.apache.hadoop.util;
-import org.apache.commons.logging.Log;
import org.slf4j.Logger;
-class LogAdapter {
- private Log LOG;
- private Logger LOGGER;
+@Deprecated
+final class LogAdapter {
Review Comment:
I wonder what the purpose of this class. Looks like it can be simply
replaced with using Logger directly, I think.
maybe it can removed later.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -491,8 +488,7 @@ private boolean isClientPortInfoAbsent(CallerContext ctx){
* perm=<permissions (optional)>
* </code>
*/
- public static final Log auditLog = LogFactory.getLog(
- FSNamesystem.class.getName() + ".audit");
+ public static final Logger AUDIT_LOG =
Logger.getLogger(FSNamesystem.class.getName() + ".audit");
Review Comment:
As long as the NameNode audit logger does not break (there are tests that
covers it) I am ok.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/IOUtils.java:
##########
@@ -256,7 +255,7 @@ public static void skipFully(InputStream in, long len)
throws IOException {
* instead
*/
@Deprecated
- public static void cleanup(Log log, java.io.Closeable... closeables) {
+ public static void cleanup(Logger log, java.io.Closeable... closeables) {
Review Comment:
Agreed we should not remove it now. Likely to break applications.
> Cleanup the commons-logging references in the code base
> -------------------------------------------------------
>
> Key: HADOOP-18206
> URL: https://issues.apache.org/jira/browse/HADOOP-18206
> Project: Hadoop Common
> Issue Type: Sub-task
> Reporter: Duo Zhang
> Assignee: Viraj Jasani
> Priority: Major
> Labels: pull-request-available
>
> Should always use slf4j
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]