[ 
https://issues.apache.org/jira/browse/HADOOP-18653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699113#comment-17699113
 ] 

ASF GitHub Bot commented on HADOOP-18653:
-----------------------------------------

virajjasani commented on code in PR #5456:
URL: https://github.com/apache/hadoop/pull/5456#discussion_r1132705151


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericsUtil.java:
##########
@@ -103,14 +113,15 @@ public static boolean isLog4jLogger(Class<?> clazz) {
    * @return true if the logger uses Log4J implementation.
    */
   public static boolean isLog4jLogger(String logger) {
-    if (logger == null) {
+    if (logger == null || !IS_LOG4J_LOGGER.get()) {
       return false;
     }
     Logger log = LoggerFactory.getLogger(logger);
     try {

Review Comment:
   How about this latest commit? 
https://github.com/apache/hadoop/pull/5456/commits/c74b7a059a528369ba49ad279880a523d84d75cb
 and 
https://github.com/apache/hadoop/pull/5456/commits/cfd3e93c6255f04131ffe135134537709d9a144b





> LogLevel servlet to determine log impl before using setLevel
> ------------------------------------------------------------
>
>                 Key: HADOOP-18653
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18653
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Viraj Jasani
>            Assignee: Viraj Jasani
>            Priority: Major
>              Labels: pull-request-available
>
> LogLevel GET API is used to set log level for a given class name dynamically. 
> While we have cleaned up the commons-logging references, it would be great to 
> determine whether slf4j log4j adapter is in the classpath before allowing 
> client to set the log level.
> Proposed changes:
>  * Use slf4j logger factory to get the log reference for the given class name
>  * Use generic utility to identify if the slf4j log4j adapter is in the 
> classpath before using log4j API to update the log level
>  * If the log4j adapter is not in the classpath, report error in the output



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to