virajjasani commented on code in PR #5315:
URL: https://github.com/apache/hadoop/pull/5315#discussion_r1092392836
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogLevel.java:
##########
@@ -340,22 +337,14 @@ public void doGet(HttpServletRequest request,
HttpServletResponse response
out.println(MARKER
+ "Submitted Class Name: <b>" + logName + "</b><br />");
- Log log = LogFactory.getLog(logName);
+ Logger log = Logger.getLogger(logName);
out.println(MARKER
+ "Log Class: <b>" + log.getClass().getName() +"</b><br />");
if (level != null) {
out.println(MARKER + "Submitted Level: <b>" + level + "</b><br />");
}
- if (log instanceof Log4JLogger) {
- process(((Log4JLogger)log).getLogger(), level, out);
- }
- else if (log instanceof Jdk14Logger) {
- process(((Jdk14Logger)log).getLogger(), level, out);
- }
- else {
- out.println("Sorry, " + log.getClass() + " not supported.<br />");
- }
+ process(log, level, out);
Review Comment:
The plan is to use SLF4J here, but we don't have hadoop-logging module yet.
When I work on the sub-task to create hadoop-logging module, with sufficient
reflections, we should be able to do `log.setLevel()` using the module. Hence,
replacing this with slf4j would be taken care of with it.
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/log/LogLevel.java:
##########
@@ -51,6 +47,7 @@
import org.apache.hadoop.util.ServletUtil;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
+import org.apache.log4j.Logger;
Review Comment:
done
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/service/ServiceOperations.java:
##########
@@ -67,26 +66,6 @@ public static Exception stopQuietly(Service service) {
return stopQuietly(LOG, service);
}
- /**
- * Stop a service; if it is null do nothing. Exceptions are caught and
- * logged at warn level. (but not Throwables). This operation is intended to
- * be used in cleanup operations
- *
- * @param log the log to warn at
- * @param service a service; may be null
- * @return any exception that was caught; null if none was.
- * @see ServiceOperations#stopQuietly(Service)
- */
- public static Exception stopQuietly(Log log, Service service) {
Review Comment:
The problem is, if we deprecate this now, we will have to keep this method.
If we keep this method, then we can't cleanup commons-logging from our
codebase, because the first arg of the method is still referring to
commons-logging logger i.e. `org.apache.commons.logging.Log`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]