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 2018/04/24 09:15:13 UTC

[GitHub] beiwei30 commented on issue #1447: NettyHelper in netty extension populated Logger "InternalLogger" in netty.

beiwei30 commented on issue #1447: NettyHelper in netty extension populated Logger "InternalLogger" in netty.
URL: https://github.com/apache/incubator-dubbo/issues/1447#issuecomment-383862175
 
 
   @teclxl That's true `com.alibaba.dubbo.remoting.transport.netty4.logging.NettyHelper.DubboLogger` will be used if dubbo boots ahead of your netty, but if you look into `com.alibaba.dubbo.common.logger.LoggerFactory`, you will find DubboLogger will eventually delegate to the real logging framework your app relies on:
   
   ```java
       // search common-used logging frameworks
       static {
           String logger = System.getProperty("dubbo.application.logger");
           if ("slf4j".equals(logger)) {
               setLoggerAdapter(new Slf4jLoggerAdapter());
           } else if ("jcl".equals(logger)) {
               setLoggerAdapter(new JclLoggerAdapter());
           } else if ("log4j".equals(logger)) {
               setLoggerAdapter(new Log4jLoggerAdapter());
           } else if ("jdk".equals(logger)) {
               setLoggerAdapter(new JdkLoggerAdapter());
           } else {
               try {
                   setLoggerAdapter(new Log4jLoggerAdapter());
               } catch (Throwable e1) {
                   try {
                       setLoggerAdapter(new Slf4jLoggerAdapter());
                   } catch (Throwable e2) {
                       try {
                           setLoggerAdapter(new JclLoggerAdapter());
                       } catch (Throwable e3) {
                           setLoggerAdapter(new JdkLoggerAdapter());
                       }
                   }
               }
           }
       }
   ```
   
   I am not sure if it satisfies what you demands. In order to help clarify this issue better, I push a same code at https://github.com/beiwei30/netty-dubbo-logging-test, pls. modify it further in order to help me understand your issue better.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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