You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NettyHelper in netty extension populated Logger "InternalLogger" in netty. #1447
public class NettyHelper {
public static void setNettyLoggerFactory() {
InternalLoggerFactory factory = InternalLoggerFactory.getDefaultFactory();
if (factory == null || !(factory instanceof DubboLoggerFactory)) {
InternalLoggerFactory.setDefaultFactory(new DubboLoggerFactory());
}
}
Added content in English. Help with Google Translate
System is TCP server using Netty4, and Dubbo is specified to use Netty4. When I add LoggingHandler to ChannelPipeline of my System, The log is not expected.
Like this:
I tracked the code and found the Logger is com.alibaba.dubbo.remoting.transport.netty4.logging.NettyHelper.DubboLogger instead of io.netty.util.internal.logging.Slf4JLogger. DubboLogger added other content arount the original log. The NeetyHelper replace the InternalLoggerFactory when Dubbo loading, like the code block above shows.
By the way.
My system build by Spring Boot, use default logging framework which is Slf4j + Logback.
Dubbo's logger is not extend default logger, but replace it.
Please consider using English, Dubbo is a global community, and all the issues may be viewed and discussed by people all over the world.
Can not work? Is there any detailed error recorded? I think LoggingHandler will also use the DubboLogger specified by Dubbo, and it will finally depend on the real logger implementation, e.g. log4j, slf4j, etc. If the logger is not specified by dubbo, someone else will specify it, will different specifier make any difference to you.
Please send more details to @[email protected] for in-depth discussion.
changed the title [-]Netty4的NettyHelper类,污染了Netty4的日志工厂[/-][+]NettyHelper in netty extension populated Logger "InternalLogger" in netty.[/+]on Mar 11, 2018
@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:
@beiwei30 I think your change can solve this issue. I think the reason is that FailsafeLogger changed all msg, too.
I saw you have already begun to slove this issue. I don't know if it is appropriate to close the issue now. Please close this issue, if you think it is appropriate.
Activity
chickenlj commentedon Mar 11, 2018
Hi,
Please consider using English, Dubbo is a global community, and all the issues may be viewed and discussed by people all over the world.
Can not work? Is there any detailed error recorded? I think LoggingHandler will also use the DubboLogger specified by Dubbo, and it will finally depend on the real logger implementation, e.g. log4j, slf4j, etc. If the logger is not specified by dubbo, someone else will specify it, will different specifier make any difference to you.
Please send more details to @[email protected] for in-depth discussion.
Thanks
[-]Netty4的NettyHelper类,污染了Netty4的日志工厂[/-][+]NettyHelper in netty extension populated Logger "InternalLogger" in netty.[/+]kimmking commentedon Mar 11, 2018
I think you can send a mail to [email protected] about keeping default logger mechanism in netty for further discussion. @teclxl
hnlxl commentedon Mar 15, 2018
Sorry, the message mail is classified by Outlook as other without push notification.
hnlxl commentedon Mar 15, 2018
Press wrong button to close.
beiwei30 commentedon Apr 24, 2018
@teclxl That's true
com.alibaba.dubbo.remoting.transport.netty4.logging.NettyHelper.DubboLoggerwill be used if dubbo boots ahead of your netty, but if you look intocom.alibaba.dubbo.common.logger.LoggerFactory, you will find DubboLogger will eventually delegate to the real logging framework your app relies on: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.
chickenlj commentedon Apr 25, 2018
I think beiwei30 and me both have clarified this issue. It shouldn't be caused by dubbo's NettyHelper.
beiwei30 commentedon Apr 26, 2018
@teclxl @chickenlj would you mind to take a look at https://github.com/beiwei30/incubator-dubbo/commit/030ebcea51603b955330059814fa95601f5dd1f6? I made an experimental change to solve this issue.
hnlxl commentedon May 4, 2018
@beiwei30 I think your change can solve this issue. I think the reason is that FailsafeLogger changed all msg, too.
I saw you have already begun to slove this issue. I don't know if it is appropriate to close the issue now. Please close this issue, if you think it is appropriate.
ralf0131 commentedon May 15, 2018
@beiwei30 Can this issue be closed?
ralf0131 commentedon Jul 20, 2018
This issue has been fixed.