dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] beiwei30 commented on issue #1447: NettyHelper in netty extension populated Logger "InternalLogger" in netty.
Date Tue, 24 Apr 2018 09:15:13 GMT
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


Mime
View raw message