diff --git a/CryptoExchange.Net/Logging/Extensions/SocketConnectionLoggingExtension.cs b/CryptoExchange.Net/Logging/Extensions/SocketConnectionLoggingExtension.cs index 3487ce9..290db82 100644 --- a/CryptoExchange.Net/Logging/Extensions/SocketConnectionLoggingExtension.cs +++ b/CryptoExchange.Net/Logging/Extensions/SocketConnectionLoggingExtension.cs @@ -37,7 +37,7 @@ namespace CryptoExchange.Net.Logging.Extensions private static readonly Action _sendingPeriodic; private static readonly Action _periodicSendFailed; private static readonly Action _sendingData; - private static readonly Action _receivedMessageNotMatchedToAnyListener; + private static readonly Action _receivedMessageNotMatchedToAnyListener; private static readonly Action _sendingByteData; static SocketConnectionLoggingExtension() @@ -177,10 +177,10 @@ namespace CryptoExchange.Net.Logging.Extensions new EventId(2028, "SendingData"), "[Sckt {SocketId}] [Req {RequestId}] sending message: {Data}"); - _receivedMessageNotMatchedToAnyListener = LoggerMessage.Define( + _receivedMessageNotMatchedToAnyListener = LoggerMessage.Define( LogLevel.Warning, new EventId(2029, "ReceivedMessageNotMatchedToAnyListener"), - "[Sckt {SocketId}] received message not matched to any listener. ListenId: {ListenId}, current listeners: [{ListenIds}]"); + "[Sckt {SocketId}] received message not matched to any listener. TypeIdentifier: {TypeIdentifier}, ListenId: {ListenId}, current listeners: [{ListenIds}]"); _failedToParse = LoggerMessage.Define( LogLevel.Warning, @@ -326,9 +326,9 @@ namespace CryptoExchange.Net.Logging.Extensions _sendingData(logger, socketId, requestId, data, null); } - public static void ReceivedMessageNotMatchedToAnyListener(this ILogger logger, int socketId, string listenId, string listenIds) + public static void ReceivedMessageNotMatchedToAnyListener(this ILogger logger, int socketId, string typeIdentifier, string listenId, string listenIds) { - _receivedMessageNotMatchedToAnyListener(logger, socketId, listenId, listenIds, null); + _receivedMessageNotMatchedToAnyListener(logger, socketId, typeIdentifier, listenId, listenIds, null); } public static void SendingByteData(this ILogger logger, int socketId, int requestId, int length) diff --git a/CryptoExchange.Net/Sockets/Default/SocketConnection.cs b/CryptoExchange.Net/Sockets/Default/SocketConnection.cs index b91e4cb..dff53dd 100644 --- a/CryptoExchange.Net/Sockets/Default/SocketConnection.cs +++ b/CryptoExchange.Net/Sockets/Default/SocketConnection.cs @@ -663,8 +663,7 @@ namespace CryptoExchange.Net.Sockets.Default { complete = true; break; - } - + } } if (complete) @@ -676,8 +675,11 @@ namespace CryptoExchange.Net.Sockets.Default { lock (_listenersLock) { - _logger.ReceivedMessageNotMatchedToAnyListener(SocketId, topicFilter!, - string.Join(",", _listeners.Select(x => string.Join(",", x.MessageRouter.Routes.Select(x => x.TopicFilter != null ? string.Join(",", x.TopicFilter) : "[null]"))))); + _logger.ReceivedMessageNotMatchedToAnyListener( + SocketId, + typeIdentifier, + topicFilter!, + string.Join(",", _listeners.Select(x => string.Join(",", x.MessageRouter.Routes.Where(x => x.TypeIdentifier == typeIdentifier).Select(x => x.TopicFilter != null ? string.Join(",", x.TopicFilter) : "[null]"))))); } } }