You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/05/06 05:17:17 UTC

[GitHub] [dubbo] ldkjdk opened a new issue, #10001: org.apache.dubbo.common.logger.LoggerFactory default is log4j

ldkjdk opened a new issue, #10001:
URL: https://github.com/apache/dubbo/issues/10001

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   <!-- For all design discussions please continue. -->
   org.apache.dubbo.common.logger.LoggerFactory default is log4j, will don't match with the log4j2 logback etc . . .
    the slf4j is default  , perhap is more best.
   
   issue code:
   
   static {
           String logger = System.getProperty("dubbo.application.logger", "");
           switch (logger) {
               case "slf4j":
                   setLoggerAdapter(new Slf4jLoggerAdapter());
                   break;
               case "jcl":
                   setLoggerAdapter(new JclLoggerAdapter());
                   break;
               case "log4j":
                   setLoggerAdapter(new Log4jLoggerAdapter());
                   break;
               case "jdk":
                   setLoggerAdapter(new JdkLoggerAdapter());
                   break;
               case "log4j2":
                   setLoggerAdapter(new Log4j2LoggerAdapter());
                   break;
               default:
                   List<Class<? extends LoggerAdapter>> candidates = Arrays.asList(
                           Log4jLoggerAdapter.class,
                           Slf4jLoggerAdapter.class,
                           Log4j2LoggerAdapter.class,
                           JclLoggerAdapter.class,
                           JdkLoggerAdapter.class
                   );
                   for (Class<? extends LoggerAdapter> clazz : candidates) {
                       try {
                           setLoggerAdapter(clazz.newInstance());
                           break;
                       } catch (Throwable ignored) {
                       }
                   }
           }
       }
   
   


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj closed issue #10001: org.apache.dubbo.common.logger.LoggerFactory default is log4j

Posted by GitBox <gi...@apache.org>.
chickenlj closed issue #10001: org.apache.dubbo.common.logger.LoggerFactory default is log4j
URL: https://github.com/apache/dubbo/issues/10001


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] chickenlj commented on issue #10001: org.apache.dubbo.common.logger.LoggerFactory default is log4j

Posted by GitBox <gi...@apache.org>.
chickenlj commented on issue #10001:
URL: https://github.com/apache/dubbo/issues/10001#issuecomment-1120150796

   Let's just keep the default behavior not changed for now and consider changing it in the next breaking major release.


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] wangchengming666 commented on issue #10001: org.apache.dubbo.common.logger.LoggerFactory default is log4j

Posted by GitBox <gi...@apache.org>.
wangchengming666 commented on issue #10001:
URL: https://github.com/apache/dubbo/issues/10001#issuecomment-1120125839

   @ldkjdk 这里如果设置slf4j为默认的话,可能会影响很多的老用户


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org