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: [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]

Reply via email to