diff --git a/src/Nacos/V2/Config/Impl/ConfigRpcServerRequestHandler.cs b/src/Nacos/V2/Config/Impl/ConfigRpcServerRequestHandler.cs index bd8ba4e..d605efc 100644 --- a/src/Nacos/V2/Config/Impl/ConfigRpcServerRequestHandler.cs +++ b/src/Nacos/V2/Config/Impl/ConfigRpcServerRequestHandler.cs @@ -1,5 +1,6 @@ namespace Nacos.V2.Config.Impl { + using Microsoft.Extensions.Logging; using Nacos.V2.Remote; using Nacos.V2.Remote.Requests; using Nacos.V2.Remote.Responses; @@ -10,11 +11,13 @@ public class ConfigRpcServerRequestHandler : IServerRequestHandler { + private readonly ILogger _logger; private ConcurrentDictionary _cacheMap; private Func _func; - public ConfigRpcServerRequestHandler(ConcurrentDictionary map, Func func) + public ConfigRpcServerRequestHandler(ILogger logger, ConcurrentDictionary map, Func func) { + this._logger = logger; this._cacheMap = map; this._func = func; } @@ -41,7 +44,7 @@ public CommonResponse RequestReply(CommonRequest request) _func.Invoke().Wait(); } - Console.WriteLine("Config RequestReply => {0}", request.ToJsonString()); + _logger?.LogDebug("Config RequestReply => {0}", request.ToJsonString()); return new ConfigChangeNotifyResponse(); } diff --git a/src/Nacos/V2/Config/Impl/ConfigRpcTransportClient.cs b/src/Nacos/V2/Config/Impl/ConfigRpcTransportClient.cs index e64a00c..e18f6d9 100644 --- a/src/Nacos/V2/Config/Impl/ConfigRpcTransportClient.cs +++ b/src/Nacos/V2/Config/Impl/ConfigRpcTransportClient.cs @@ -247,7 +247,7 @@ private ClientAbilities InitAbilities() private void InitHandlerRpcClient(RpcClient rpcClientInner) { - rpcClientInner.RegisterServerPushResponseHandler(new ConfigRpcServerRequestHandler(_cacheMap, NotifyListenConfig)); + rpcClientInner.RegisterServerPushResponseHandler(new ConfigRpcServerRequestHandler(_logger, _cacheMap, NotifyListenConfig)); rpcClientInner.RegisterConnectionListener(new ConfigRpcConnectionEventListener(_logger, rpcClientInner, _cacheMap, _listenExecutebell)); rpcClientInner.Init(new ConfigRpcServerListFactory(_serverListManager));