EventId starts at 1 for logging (#1318)
This commit is contained in:
parent
68aa609650
commit
dfe0697f06
|
|
@ -11,112 +11,112 @@ namespace Microsoft.AspNetCore.SignalR.Client.Internal
|
|||
{
|
||||
// Category: HubConnection
|
||||
private static readonly Action<ILogger, string, string, int, Exception> _preparingNonBlockingInvocation =
|
||||
LoggerMessage.Define<string, string, int>(LogLevel.Trace, new EventId(0, nameof(PreparingNonBlockingInvocation)), "Preparing non-blocking invocation '{invocationId}' of '{target}', with {argumentCount} argument(s).");
|
||||
LoggerMessage.Define<string, string, int>(LogLevel.Trace, new EventId(1, nameof(PreparingNonBlockingInvocation)), "Preparing non-blocking invocation '{invocationId}' of '{target}', with {argumentCount} argument(s).");
|
||||
|
||||
private static readonly Action<ILogger, string, string, string, int, Exception> _preparingBlockingInvocation =
|
||||
LoggerMessage.Define<string, string, string, int>(LogLevel.Trace, new EventId(1, nameof(PreparingBlockingInvocation)), "Preparing blocking invocation '{invocationId}' of '{target}', with return type '{returnType}' and {argumentCount} argument(s).");
|
||||
LoggerMessage.Define<string, string, string, int>(LogLevel.Trace, new EventId(2, nameof(PreparingBlockingInvocation)), "Preparing blocking invocation '{invocationId}' of '{target}', with return type '{returnType}' and {argumentCount} argument(s).");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _registerInvocation =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(2, nameof(RegisterInvocation)), "Registering Invocation ID '{invocationId}' for tracking.");
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(3, nameof(RegisterInvocation)), "Registering Invocation ID '{invocationId}' for tracking.");
|
||||
|
||||
private static readonly Action<ILogger, string, string, string, string, Exception> _issueInvocation =
|
||||
LoggerMessage.Define<string, string, string, string>(LogLevel.Trace, new EventId(3, nameof(IssueInvocation)), "Issuing Invocation '{invocationId}': {returnType} {methodName}({args}).");
|
||||
LoggerMessage.Define<string, string, string, string>(LogLevel.Trace, new EventId(4, nameof(IssueInvocation)), "Issuing Invocation '{invocationId}': {returnType} {methodName}({args}).");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _sendInvocation =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(4, nameof(SendInvocation)), "Sending Invocation '{invocationId}'.");
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(5, nameof(SendInvocation)), "Sending Invocation '{invocationId}'.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _sendInvocationCompleted =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(5, nameof(SendInvocationCompleted)), "Sending Invocation '{invocationId}' completed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(6, nameof(SendInvocationCompleted)), "Sending Invocation '{invocationId}' completed.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _sendInvocationFailed =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(6, nameof(SendInvocationFailed)), "Sending Invocation '{invocationId}' failed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(7, nameof(SendInvocationFailed)), "Sending Invocation '{invocationId}' failed.");
|
||||
|
||||
private static readonly Action<ILogger, string, string, string, Exception> _receivedInvocation =
|
||||
LoggerMessage.Define<string, string, string>(LogLevel.Trace, new EventId(7, nameof(ReceivedInvocation)), "Received Invocation '{invocationId}': {methodName}({args}).");
|
||||
LoggerMessage.Define<string, string, string>(LogLevel.Trace, new EventId(8, nameof(ReceivedInvocation)), "Received Invocation '{invocationId}': {methodName}({args}).");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _dropCompletionMessage =
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(8, nameof(DropCompletionMessage)), "Dropped unsolicited Completion message for invocation '{invocationId}'.");
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(9, nameof(DropCompletionMessage)), "Dropped unsolicited Completion message for invocation '{invocationId}'.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _dropStreamMessage =
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(9, nameof(DropStreamMessage)), "Dropped unsolicited StreamItem message for invocation '{invocationId}'.");
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(10, nameof(DropStreamMessage)), "Dropped unsolicited StreamItem message for invocation '{invocationId}'.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _shutdownConnection =
|
||||
LoggerMessage.Define(LogLevel.Trace, new EventId(10, nameof(ShutdownConnection)), "Shutting down connection.");
|
||||
LoggerMessage.Define(LogLevel.Trace, new EventId(11, nameof(ShutdownConnection)), "Shutting down connection.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _shutdownWithError =
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(11, nameof(ShutdownWithError)), "Connection is shutting down due to an error.");
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(12, nameof(ShutdownWithError)), "Connection is shutting down due to an error.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _removeInvocation =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(12, nameof(RemoveInvocation)), "Removing pending invocation {invocationId}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(13, nameof(RemoveInvocation)), "Removing pending invocation {invocationId}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _missingHandler =
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(13, nameof(MissingHandler)), "Failed to find handler for '{target}' method.");
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(14, nameof(MissingHandler)), "Failed to find handler for '{target}' method.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedStreamItem =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(14, nameof(ReceivedStreamItem)), "Received StreamItem for Invocation {invocationId}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(15, nameof(ReceivedStreamItem)), "Received StreamItem for Invocation {invocationId}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _cancelingStreamItem =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(15, nameof(CancelingStreamItem)), "Canceling dispatch of StreamItem message for Invocation {invocationId}. The invocation was canceled.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(16, nameof(CancelingStreamItem)), "Canceling dispatch of StreamItem message for Invocation {invocationId}. The invocation was canceled.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedStreamItemAfterClose =
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(16, nameof(ReceivedStreamItemAfterClose)), "Invocation {invocationId} received stream item after channel was closed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(17, nameof(ReceivedStreamItemAfterClose)), "Invocation {invocationId} received stream item after channel was closed.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedInvocationCompletion =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(17, nameof(ReceivedInvocationCompletion)), "Received Completion for Invocation {invocationId}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(18, nameof(ReceivedInvocationCompletion)), "Received Completion for Invocation {invocationId}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _cancelingInvocationCompletion =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(18, nameof(CancelingInvocationCompletion)), "Canceling dispatch of Completion message for Invocation {invocationId}. The invocation was canceled.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(19, nameof(CancelingInvocationCompletion)), "Canceling dispatch of Completion message for Invocation {invocationId}. The invocation was canceled.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _cancelingCompletion =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(19, nameof(CancelingCompletion)), "Canceling dispatch of Completion message for Invocation {invocationId}. The invocation was canceled.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(20, nameof(CancelingCompletion)), "Canceling dispatch of Completion message for Invocation {invocationId}. The invocation was canceled.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invokeAfterTermination =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(20, nameof(InvokeAfterTermination)), "Invoke for Invocation '{invocationId}' was called after the connection was terminated.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(21, nameof(InvokeAfterTermination)), "Invoke for Invocation '{invocationId}' was called after the connection was terminated.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invocationAlreadyInUse =
|
||||
LoggerMessage.Define<string>(LogLevel.Critical, new EventId(21, nameof(InvocationAlreadyInUse)), "Invocation ID '{invocationId}' is already in use.");
|
||||
LoggerMessage.Define<string>(LogLevel.Critical, new EventId(22, nameof(InvocationAlreadyInUse)), "Invocation ID '{invocationId}' is already in use.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedUnexpectedResponse =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(22, nameof(ReceivedUnexpectedResponse)), "Unsolicited response received for invocation '{invocationId}'.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(23, nameof(ReceivedUnexpectedResponse)), "Unsolicited response received for invocation '{invocationId}'.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _hubProtocol =
|
||||
LoggerMessage.Define<string>(LogLevel.Information, new EventId(23, nameof(HubProtocol)), "Using HubProtocol '{protocol}'.");
|
||||
LoggerMessage.Define<string>(LogLevel.Information, new EventId(24, nameof(HubProtocol)), "Using HubProtocol '{protocol}'.");
|
||||
|
||||
private static readonly Action<ILogger, string, string, string, int, Exception> _preparingStreamingInvocation =
|
||||
LoggerMessage.Define<string, string, string, int>(LogLevel.Trace, new EventId(24, nameof(PreparingStreamingInvocation)), "Preparing streaming invocation '{invocationId}' of '{target}', with return type '{returnType}' and {argumentCount} argument(s).");
|
||||
LoggerMessage.Define<string, string, string, int>(LogLevel.Trace, new EventId(25, nameof(PreparingStreamingInvocation)), "Preparing streaming invocation '{invocationId}' of '{target}', with return type '{returnType}' and {argumentCount} argument(s).");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _resettingKeepAliveTimer =
|
||||
LoggerMessage.Define(LogLevel.Trace, new EventId(25, nameof(ResettingKeepAliveTimer)), "Resetting keep-alive timer, received a message from the server.");
|
||||
LoggerMessage.Define(LogLevel.Trace, new EventId(26, nameof(ResettingKeepAliveTimer)), "Resetting keep-alive timer, received a message from the server.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _errorDuringClosedEvent =
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(26, nameof(ErrorDuringClosedEvent)), "An exception was thrown in the handler for the Closed event.");
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(27, nameof(ErrorDuringClosedEvent)), "An exception was thrown in the handler for the Closed event.");
|
||||
|
||||
// Category: Streaming and NonStreaming
|
||||
private static readonly Action<ILogger, string, Exception> _invocationCreated =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(0, nameof(InvocationCreated)), "Invocation {invocationId} created.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(1, nameof(InvocationCreated)), "Invocation {invocationId} created.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invocationDisposed =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(1, nameof(InvocationDisposed)), "Invocation {invocationId} disposed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(2, nameof(InvocationDisposed)), "Invocation {invocationId} disposed.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invocationCompleted =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(2, nameof(InvocationCompleted)), "Invocation {invocationId} marked as completed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(3, nameof(InvocationCompleted)), "Invocation {invocationId} marked as completed.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _invocationFailed =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(3, nameof(InvocationFailed)), "Invocation {invocationId} marked as failed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(4, nameof(InvocationFailed)), "Invocation {invocationId} marked as failed.");
|
||||
|
||||
// Category: Streaming
|
||||
private static readonly Action<ILogger, string, Exception> _errorWritingStreamItem =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(4, nameof(ErrorWritingStreamItem)), "Invocation {invocationId} caused an error trying to write a stream item.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(5, nameof(ErrorWritingStreamItem)), "Invocation {invocationId} caused an error trying to write a stream item.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedUnexpectedComplete =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(5, nameof(ReceivedUnexpectedComplete)), "Invocation {invocationId} received a completion result, but was invoked as a streaming invocation.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(6, nameof(ReceivedUnexpectedComplete)), "Invocation {invocationId} received a completion result, but was invoked as a streaming invocation.");
|
||||
|
||||
// Category: NonStreaming
|
||||
private static readonly Action<ILogger, string, Exception> _streamItemOnNonStreamInvocation =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(4, nameof(StreamItemOnNonStreamInvocation)), "Invocation {invocationId} received stream item but was invoked as a non-streamed invocation.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(5, nameof(StreamItemOnNonStreamInvocation)), "Invocation {invocationId} received stream item but was invoked as a non-streamed invocation.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _errorInvokingClientSideMethod =
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(5, nameof(ErrorInvokingClientSideMethod)), "Invoking client side method '{methodName}' failed.");
|
||||
LoggerMessage.Define<string>(LogLevel.Error, new EventId(6, nameof(ErrorInvokingClientSideMethod)), "Invoking client side method '{methodName}' failed.");
|
||||
|
||||
public static void PreparingNonBlockingInvocation(this ILogger logger, string invocationId, string target, int count)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -79,10 +79,10 @@ namespace Microsoft.AspNetCore.SignalR.Internal
|
|||
|
||||
// Category: DefaultHubProtocolResolver
|
||||
private static readonly Action<ILogger, string, Type, Exception> _registeredSignalRProtocol =
|
||||
LoggerMessage.Define<string, Type>(LogLevel.Debug, new EventId(0, nameof(RegisteredSignalRProtocol)), "Registered SignalR Protocol: {ProtocolName}, implemented by {ImplementationType}.");
|
||||
LoggerMessage.Define<string, Type>(LogLevel.Debug, new EventId(1, nameof(RegisteredSignalRProtocol)), "Registered SignalR Protocol: {ProtocolName}, implemented by {ImplementationType}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _foundImplementationForProtocol =
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(1, nameof(FoundImplementationForProtocol)), "Found protocol implementation for requested protocol: {ProtocolName}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(2, nameof(FoundImplementationForProtocol)), "Found protocol implementation for requested protocol: {ProtocolName}.");
|
||||
|
||||
public static void UsingHubProtocol(this ILogger logger, string hubProtocol)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,37 +12,37 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Internal
|
|||
{
|
||||
// Category: RedisHubLifetimeManager<THub>
|
||||
private static readonly Action<ILogger, string, Exception> _connectingToEndpoints =
|
||||
LoggerMessage.Define<string>(LogLevel.Information, new EventId(0, nameof(ConnectingToEndpoints)), "Connecting to Redis endpoints: {endpoints}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Information, new EventId(1, nameof(ConnectingToEndpoints)), "Connecting to Redis endpoints: {endpoints}.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _connected =
|
||||
LoggerMessage.Define(LogLevel.Information, new EventId(1, nameof(Connected)), "Connected to Redis.");
|
||||
LoggerMessage.Define(LogLevel.Information, new EventId(2, nameof(Connected)), "Connected to Redis.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _subscribing =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(2, nameof(Subscribing)), "Subscribing to channel: {channel}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(3, nameof(Subscribing)), "Subscribing to channel: {channel}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _receivedFromChannel =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(3, nameof(ReceivedFromChannel)), "Received message from Redis channel {channel}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(4, nameof(ReceivedFromChannel)), "Received message from Redis channel {channel}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _publishToChannel =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(4, nameof(PublishToChannel)), "Publishing message to Redis channel {channel}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(5, nameof(PublishToChannel)), "Publishing message to Redis channel {channel}.");
|
||||
|
||||
private static readonly Action<ILogger, string, Exception> _unsubscribe =
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(5, nameof(Unsubscribe)), "Unsubscribing from channel: {channel}.");
|
||||
LoggerMessage.Define<string>(LogLevel.Trace, new EventId(6, nameof(Unsubscribe)), "Unsubscribing from channel: {channel}.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _notConnected =
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(6, nameof(Connected)), "Not connected to Redis.");
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(7, nameof(Connected)), "Not connected to Redis.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _connectionRestored =
|
||||
LoggerMessage.Define(LogLevel.Information, new EventId(7, nameof(ConnectionRestored)), "Connection to Redis restored.");
|
||||
LoggerMessage.Define(LogLevel.Information, new EventId(8, nameof(ConnectionRestored)), "Connection to Redis restored.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _connectionFailed =
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(8, nameof(ConnectionFailed)), "Connection to Redis failed.");
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(9, nameof(ConnectionFailed)), "Connection to Redis failed.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _failedWritingMessage =
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(9, nameof(FailedWritingMessage)), "Failed writing message.");
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(10, nameof(FailedWritingMessage)), "Failed writing message.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _internalMessageFailed =
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(10, nameof(InternalMessageFailed)), "Error processing message for internal server message.");
|
||||
LoggerMessage.Define(LogLevel.Warning, new EventId(11, nameof(InternalMessageFailed)), "Error processing message for internal server message.");
|
||||
|
||||
public static void ConnectingToEndpoints(this ILogger logger, EndPointCollection endpoints)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,165 +11,165 @@ namespace Microsoft.AspNetCore.Sockets.Client.Internal
|
|||
{
|
||||
// Category: Shared with LongPollingTransport, WebSocketsTransport and ServerSentEventsTransport
|
||||
private static readonly Action<ILogger, DateTime, string, TransferMode, Exception> _startTransport =
|
||||
LoggerMessage.Define<DateTime, string, TransferMode>(LogLevel.Information, new EventId(0, nameof(StartTransport)), "{time}: Connection Id {connectionId}: Starting transport. Transfer mode: {transferMode}.");
|
||||
LoggerMessage.Define<DateTime, string, TransferMode>(LogLevel.Information, new EventId(1, nameof(StartTransport)), "{time}: Connection Id {connectionId}: Starting transport. Transfer mode: {transferMode}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _transportStopped =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(1, nameof(TransportStopped)), "{time}: Connection Id {connectionId}: Transport stopped.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(2, nameof(TransportStopped)), "{time}: Connection Id {connectionId}: Transport stopped.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _startReceive =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(2, nameof(StartReceive)), "{time}: Connection Id {connectionId}: Starting receive loop.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(3, nameof(StartReceive)), "{time}: Connection Id {connectionId}: Starting receive loop.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _receiveStopped =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(3, nameof(ReceiveStopped)), "{time}: Connection Id {connectionId}: Receive loop stopped.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(ReceiveStopped)), "{time}: Connection Id {connectionId}: Receive loop stopped.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _receiveCanceled =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(ReceiveCanceled)), "{time}: Connection Id {connectionId}: Receive loop canceled.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(5, nameof(ReceiveCanceled)), "{time}: Connection Id {connectionId}: Receive loop canceled.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _transportStopping =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(5, nameof(TransportStopping)), "{time}: Connection Id {connectionId}: Transport is stopping.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(6, nameof(TransportStopping)), "{time}: Connection Id {connectionId}: Transport is stopping.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendStarted =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(6, nameof(SendStarted)), "{time}: Connection Id {connectionId}: Starting the send loop.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(7, nameof(SendStarted)), "{time}: Connection Id {connectionId}: Starting the send loop.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendStopped =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(7, nameof(SendStopped)), "{time}: Connection Id {connectionId}: Send loop stopped.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(8, nameof(SendStopped)), "{time}: Connection Id {connectionId}: Send loop stopped.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendCanceled =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(8, nameof(SendCanceled)), "{time}: Connection Id {connectionId}: Send loop canceled.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(9, nameof(SendCanceled)), "{time}: Connection Id {connectionId}: Send loop canceled.");
|
||||
|
||||
// Category: WebSocketsTransport
|
||||
private static readonly Action<ILogger, DateTime, string, WebSocketCloseStatus?, Exception> _webSocketClosed =
|
||||
LoggerMessage.Define<DateTime, string, WebSocketCloseStatus?>(LogLevel.Information, new EventId(9, nameof(WebSocketClosed)), "{time}: Connection Id {connectionId}: Websocket closed by the server. Close status {closeStatus}.");
|
||||
LoggerMessage.Define<DateTime, string, WebSocketCloseStatus?>(LogLevel.Information, new EventId(10, nameof(WebSocketClosed)), "{time}: Connection Id {connectionId}: Websocket closed by the server. Close status {closeStatus}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, WebSocketMessageType, int, bool, Exception> _messageReceived =
|
||||
LoggerMessage.Define<DateTime, string, WebSocketMessageType, int, bool>(LogLevel.Debug, new EventId(10, nameof(MessageReceived)), "{time}: Connection Id {connectionId}: Message received. Type: {messageType}, size: {count}, EndOfMessage: {endOfMessage}.");
|
||||
LoggerMessage.Define<DateTime, string, WebSocketMessageType, int, bool>(LogLevel.Debug, new EventId(11, nameof(MessageReceived)), "{time}: Connection Id {connectionId}: Message received. Type: {messageType}, size: {count}, EndOfMessage: {endOfMessage}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _messageToApp =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(11, nameof(MessageToApp)), "{time}: Connection Id {connectionId}: Passing message to application. Payload size: {count}.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(12, nameof(MessageToApp)), "{time}: Connection Id {connectionId}: Passing message to application. Payload size: {count}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _receivedFromApp =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(12, nameof(ReceivedFromApp)), "{time}: Connection Id {connectionId}: Received message from application. Payload size: {count}.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(13, nameof(ReceivedFromApp)), "{time}: Connection Id {connectionId}: Received message from application. Payload size: {count}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendMessageCanceled =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(13, nameof(SendMessageCanceled)), "{time}: Connection Id {connectionId}: Sending a message canceled.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(14, nameof(SendMessageCanceled)), "{time}: Connection Id {connectionId}: Sending a message canceled.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _errorSendingMessage =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(14, nameof(ErrorSendingMessage)), "{time}: Connection Id {connectionId}: Error while sending a message.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(15, nameof(ErrorSendingMessage)), "{time}: Connection Id {connectionId}: Error while sending a message.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _closingWebSocket =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(15, nameof(ClosingWebSocket)), "{time}: Connection Id {connectionId}: Closing WebSocket.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(16, nameof(ClosingWebSocket)), "{time}: Connection Id {connectionId}: Closing WebSocket.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _closingWebSocketFailed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(16, nameof(ClosingWebSocketFailed)), "{time}: Connection Id {connectionId}: Closing webSocket failed.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(17, nameof(ClosingWebSocketFailed)), "{time}: Connection Id {connectionId}: Closing webSocket failed.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _cancelMessage =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(17, nameof(CancelMessage)), "{time}: Connection Id {connectionId}: Canceled passing message to application.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(18, nameof(CancelMessage)), "{time}: Connection Id {connectionId}: Canceled passing message to application.");
|
||||
|
||||
// Category: ServerSentEventsTransport and LongPollingTransport
|
||||
private static readonly Action<ILogger, DateTime, string, int, Uri, Exception> _sendingMessages =
|
||||
LoggerMessage.Define<DateTime, string, int, Uri>(LogLevel.Debug, new EventId(9, nameof(SendingMessages)), "{time}: Connection Id {connectionId}: Sending {count} message(s) to the server using url: {url}.");
|
||||
LoggerMessage.Define<DateTime, string, int, Uri>(LogLevel.Debug, new EventId(10, nameof(SendingMessages)), "{time}: Connection Id {connectionId}: Sending {count} message(s) to the server using url: {url}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sentSuccessfully =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(10, nameof(SentSuccessfully)), "{time}: Connection Id {connectionId}: Message(s) sent successfully.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(11, nameof(SentSuccessfully)), "{time}: Connection Id {connectionId}: Message(s) sent successfully.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _noMessages =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(11, nameof(NoMessages)), "{time}: Connection Id {connectionId}: No messages in batch to send.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(12, nameof(NoMessages)), "{time}: Connection Id {connectionId}: No messages in batch to send.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Uri, Exception> _errorSending =
|
||||
LoggerMessage.Define<DateTime, string, Uri>(LogLevel.Error, new EventId(12, nameof(ErrorSending)), "{time}: Connection Id {connectionId}: Error while sending to '{url}'.");
|
||||
LoggerMessage.Define<DateTime, string, Uri>(LogLevel.Error, new EventId(13, nameof(ErrorSending)), "{time}: Connection Id {connectionId}: Error while sending to '{url}'.");
|
||||
|
||||
// Category: ServerSentEventsTransport
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _eventStreamEnded =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(13, nameof(EventStreamEnded)), "{time}: Connection Id {connectionId}: Server-Sent Event Stream ended.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(14, nameof(EventStreamEnded)), "{time}: Connection Id {connectionId}: Server-Sent Event Stream ended.");
|
||||
|
||||
// Category: LongPollingTransport
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _closingConnection =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(13, nameof(ClosingConnection)), "{time}: Connection Id {connectionId}: The server is closing the connection.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(14, nameof(ClosingConnection)), "{time}: Connection Id {connectionId}: The server is closing the connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _receivedMessages =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(14, nameof(ReceivedMessages)), "{time}: Connection Id {connectionId}: Received messages from the server.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(15, nameof(ReceivedMessages)), "{time}: Connection Id {connectionId}: Received messages from the server.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Uri, Exception> _errorPolling =
|
||||
LoggerMessage.Define<DateTime, string, Uri>(LogLevel.Error, new EventId(15, nameof(ErrorPolling)), "{time}: Connection Id {connectionId}: Error while polling '{pollUrl}'.");
|
||||
LoggerMessage.Define<DateTime, string, Uri>(LogLevel.Error, new EventId(16, nameof(ErrorPolling)), "{time}: Connection Id {connectionId}: Error while polling '{pollUrl}'.");
|
||||
|
||||
// Category: HttpConnection
|
||||
private static readonly Action<ILogger, DateTime, Exception> _httpConnectionStarting =
|
||||
LoggerMessage.Define<DateTime>(LogLevel.Debug, new EventId(0, nameof(HttpConnectionStarting)), "{time}: Starting connection.");
|
||||
LoggerMessage.Define<DateTime>(LogLevel.Debug, new EventId(1, nameof(HttpConnectionStarting)), "{time}: Starting connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _httpConnectionClosed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(1, nameof(HttpConnectionClosed)), "{time}: Connection Id {connectionId}: Connection was closed from a different thread.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(2, nameof(HttpConnectionClosed)), "{time}: Connection Id {connectionId}: Connection was closed from a different thread.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Uri, Exception> _startingTransport =
|
||||
LoggerMessage.Define<DateTime, string, string, Uri>(LogLevel.Debug, new EventId(2, nameof(StartingTransport)), "{time}: Connection Id {connectionId}: Starting transport '{transport}' with Url: {url}.");
|
||||
LoggerMessage.Define<DateTime, string, string, Uri>(LogLevel.Debug, new EventId(3, nameof(StartingTransport)), "{time}: Connection Id {connectionId}: Starting transport '{transport}' with Url: {url}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _raiseConnected =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(3, nameof(RaiseConnected)), "{time}: Connection Id {connectionId}: Raising Connected event.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(RaiseConnected)), "{time}: Connection Id {connectionId}: Raising Connected event.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _processRemainingMessages =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(ProcessRemainingMessages)), "{time}: Connection Id {connectionId}: Ensuring all outstanding messages are processed.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(5, nameof(ProcessRemainingMessages)), "{time}: Connection Id {connectionId}: Ensuring all outstanding messages are processed.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _drainEvents =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(5, nameof(DrainEvents)), "{time}: Connection Id {connectionId}: Draining event queue.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(6, nameof(DrainEvents)), "{time}: Connection Id {connectionId}: Draining event queue.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _completeClosed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(6, nameof(CompleteClosed)), "{time}: Connection Id {connectionId}: Completing Closed task.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(7, nameof(CompleteClosed)), "{time}: Connection Id {connectionId}: Completing Closed task.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, Uri, Exception> _establishingConnection =
|
||||
LoggerMessage.Define<DateTime, Uri>(LogLevel.Debug, new EventId(7, nameof(EstablishingConnection)), "{time}: Establishing Connection at: {url}.");
|
||||
LoggerMessage.Define<DateTime, Uri>(LogLevel.Debug, new EventId(8, nameof(EstablishingConnection)), "{time}: Establishing Connection at: {url}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, Uri, Exception> _errorWithNegotiation =
|
||||
LoggerMessage.Define<DateTime, Uri>(LogLevel.Error, new EventId(8, nameof(ErrorWithNegotiation)), "{time}: Failed to start connection. Error getting negotiation response from '{url}'.");
|
||||
LoggerMessage.Define<DateTime, Uri>(LogLevel.Error, new EventId(9, nameof(ErrorWithNegotiation)), "{time}: Failed to start connection. Error getting negotiation response from '{url}'.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _errorStartingTransport =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(9, nameof(ErrorStartingTransport)), "{time}: Connection Id {connectionId}: Failed to start connection. Error starting transport '{transport}'.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(10, nameof(ErrorStartingTransport)), "{time}: Connection Id {connectionId}: Failed to start connection. Error starting transport '{transport}'.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _httpReceiveStarted =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(10, nameof(HttpReceiveStarted)), "{time}: Connection Id {connectionId}: Beginning receive loop.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(11, nameof(HttpReceiveStarted)), "{time}: Connection Id {connectionId}: Beginning receive loop.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _skipRaisingReceiveEvent =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(11, nameof(SkipRaisingReceiveEvent)), "{time}: Connection Id {connectionId}: Message received but connection is not connected. Skipping raising Received event.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(12, nameof(SkipRaisingReceiveEvent)), "{time}: Connection Id {connectionId}: Message received but connection is not connected. Skipping raising Received event.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _scheduleReceiveEvent =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(12, nameof(ScheduleReceiveEvent)), "{time}: Connection Id {connectionId}: Scheduling raising Received event.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(13, nameof(ScheduleReceiveEvent)), "{time}: Connection Id {connectionId}: Scheduling raising Received event.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _raiseReceiveEvent =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(13, nameof(RaiseReceiveEvent)), "{time}: Connection Id {connectionId}: Raising Received event.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(14, nameof(RaiseReceiveEvent)), "{time}: Connection Id {connectionId}: Raising Received event.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _failedReadingMessage =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(14, nameof(FailedReadingMessage)), "{time}: Connection Id {connectionId}: Could not read message.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(15, nameof(FailedReadingMessage)), "{time}: Connection Id {connectionId}: Could not read message.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _errorReceiving =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(15, nameof(ErrorReceiving)), "{time}: Connection Id {connectionId}: Error receiving message.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(16, nameof(ErrorReceiving)), "{time}: Connection Id {connectionId}: Error receiving message.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _endReceive =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(16, nameof(EndReceive)), "{time}: Connection Id {connectionId}: Ending receive loop.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(17, nameof(EndReceive)), "{time}: Connection Id {connectionId}: Ending receive loop.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendingMessage =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(17, nameof(SendingMessage)), "{time}: Connection Id {connectionId}: Sending message.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(18, nameof(SendingMessage)), "{time}: Connection Id {connectionId}: Sending message.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _stoppingClient =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(18, nameof(StoppingClient)), "{time}: Connection Id {connectionId}: Stopping client.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(19, nameof(StoppingClient)), "{time}: Connection Id {connectionId}: Stopping client.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _exceptionThrownFromCallback =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(19, nameof(ExceptionThrownFromCallback)), "{time}: Connection Id {connectionId}: An exception was thrown from the '{callback}' callback.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(20, nameof(ExceptionThrownFromCallback)), "{time}: Connection Id {connectionId}: An exception was thrown from the '{callback}' callback.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _disposingClient =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(20, nameof(DisposingClient)), "{time}: Connection Id {connectionId}: Disposing client.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(21, nameof(DisposingClient)), "{time}: Connection Id {connectionId}: Disposing client.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _abortingClient =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(21, nameof(AbortingClient)), "{time}: Connection Id {connectionId}: Aborting client.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(22, nameof(AbortingClient)), "{time}: Connection Id {connectionId}: Aborting client.");
|
||||
|
||||
private static readonly Action<ILogger, Exception> _errorDuringClosedEvent =
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(22, nameof(ErrorDuringClosedEvent)), "An exception was thrown in the handler for the Closed event.");
|
||||
LoggerMessage.Define(LogLevel.Error, new EventId(23, nameof(ErrorDuringClosedEvent)), "An exception was thrown in the handler for the Closed event.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _skippingStop =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(23, nameof(SkippingStop)), "{time}: Connection Id {connectionId}: Skipping stop, connection is already stopped.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(24, nameof(SkippingStop)), "{time}: Connection Id {connectionId}: Skipping stop, connection is already stopped.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _skippingDispose =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(24, nameof(SkippingDispose)), "{time}: Connection Id {connectionId}: Skipping dispose, connection is already disposed.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(25, nameof(SkippingDispose)), "{time}: Connection Id {connectionId}: Skipping dispose, connection is already disposed.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, string, Exception> _connectionStateChanged =
|
||||
LoggerMessage.Define<DateTime, string, string, string>(LogLevel.Debug, new EventId(25, nameof(ConnectionStateChanged)), "{time}: Connection Id {connectionId}: Connection state changed from {previousState} to {newState}.");
|
||||
LoggerMessage.Define<DateTime, string, string, string>(LogLevel.Debug, new EventId(26, nameof(ConnectionStateChanged)), "{time}: Connection Id {connectionId}: Connection state changed from {previousState} to {newState}.");
|
||||
|
||||
public static void StartTransport(this ILogger logger, string connectionId, TransferMode transferMode)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,94 +11,94 @@ namespace Microsoft.AspNetCore.Sockets.Internal
|
|||
{
|
||||
// Category: LongPollingTransport
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _longPolling204 =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Information, new EventId(0, nameof(LongPolling204)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Terminating Long Polling connection by sending 204 response.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Information, new EventId(1, nameof(LongPolling204)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Terminating Long Polling connection by sending 204 response.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _pollTimedOut =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Information, new EventId(1, nameof(PollTimedOut)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Poll request timed out. Sending 200 response to connection.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Information, new EventId(2, nameof(PollTimedOut)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Poll request timed out. Sending 200 response to connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, int, Exception> _longPollingWritingMessage =
|
||||
LoggerMessage.Define<DateTime, string, string, int>(LogLevel.Debug, new EventId(2, nameof(LongPollingWritingMessage)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Writing a {count} byte message to connection.");
|
||||
LoggerMessage.Define<DateTime, string, string, int>(LogLevel.Debug, new EventId(3, nameof(LongPollingWritingMessage)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Writing a {count} byte message to connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _longPollingDisconnected =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(3, nameof(LongPollingDisconnected)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Client disconnected from Long Polling endpoint for connection.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(4, nameof(LongPollingDisconnected)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Client disconnected from Long Polling endpoint for connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _longPollingTerminated =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(4, nameof(LongPollingTerminated)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Long Polling transport was terminated due to an error on connection.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Error, new EventId(5, nameof(LongPollingTerminated)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Long Polling transport was terminated due to an error on connection.");
|
||||
|
||||
// Category: HttpConnectionDispatcher
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _connectionDisposed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(0, nameof(ConnectionDisposed)), "{time}: Connection Id {connectionId} was disposed.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(1, nameof(ConnectionDisposed)), "{time}: Connection Id {connectionId} was disposed.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _connectionAlreadyActive =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(1, nameof(ConnectionAlreadyActive)), "{time}: Connection Id {connectionId} is already active via {requestId}.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(2, nameof(ConnectionAlreadyActive)), "{time}: Connection Id {connectionId} is already active via {requestId}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _pollCanceled =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(2, nameof(PollCanceled)), "{time}: Previous poll canceled for {connectionId} on {requestId}.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(3, nameof(PollCanceled)), "{time}: Previous poll canceled for {connectionId} on {requestId}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _establishedConnection =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(3, nameof(EstablishedConnection)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Establishing new connection.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(4, nameof(EstablishedConnection)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Establishing new connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, string, Exception> _resumingConnection =
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(4, nameof(ResumingConnection)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Resuming existing connection.");
|
||||
LoggerMessage.Define<DateTime, string, string>(LogLevel.Debug, new EventId(5, nameof(ResumingConnection)), "{time}: Connection Id {connectionId}, Request Id {requestId}: Resuming existing connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _receivedBytes =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(5, nameof(ReceivedBytes)), "{time}: Connection Id {connectionId}: Received {count} bytes.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(6, nameof(ReceivedBytes)), "{time}: Connection Id {connectionId}: Received {count} bytes.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, TransportType, Exception> _transportNotSupported =
|
||||
LoggerMessage.Define<DateTime, string, TransportType>(LogLevel.Debug, new EventId(6, nameof(TransportNotSupported)), "{time}: Connection Id {connectionId}: {transportType} transport not supported by this endpoint type.");
|
||||
LoggerMessage.Define<DateTime, string, TransportType>(LogLevel.Debug, new EventId(7, nameof(TransportNotSupported)), "{time}: Connection Id {connectionId}: {transportType} transport not supported by this endpoint type.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, TransportType, TransportType, Exception> _cannotChangeTransport =
|
||||
LoggerMessage.Define<DateTime, string, TransportType, TransportType>(LogLevel.Debug, new EventId(7, nameof(CannotChangeTransport)), "{time}: Connection Id {connectionId}: Cannot change transports mid-connection; currently using {transportType}, requesting {requestedTransport}.");
|
||||
LoggerMessage.Define<DateTime, string, TransportType, TransportType>(LogLevel.Debug, new EventId(8, nameof(CannotChangeTransport)), "{time}: Connection Id {connectionId}: Cannot change transports mid-connection; currently using {transportType}, requesting {requestedTransport}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _postNotallowedForWebsockets =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(8, nameof(PostNotAllowedForWebSockets)), "{time}: Connection Id {connectionId}: POST requests are not allowed for websocket connections.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(9, nameof(PostNotAllowedForWebSockets)), "{time}: Connection Id {connectionId}: POST requests are not allowed for websocket connections.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _negotiationRequest =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(8, nameof(NegotiationRequest)), "{time}: Connection Id {connectionId}: Sending negotiation response.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(10, nameof(NegotiationRequest)), "{time}: Connection Id {connectionId}: Sending negotiation response.");
|
||||
|
||||
// Category: WebSocketsTransport
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _socketOpened =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(0, nameof(SocketOpened)), "{time}: Connection Id {connectionId}: Socket opened.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(1, nameof(SocketOpened)), "{time}: Connection Id {connectionId}: Socket opened.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _socketClosed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(1, nameof(SocketClosed)), "{time}: Connection Id {connectionId}: Socket closed.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Information, new EventId(2, nameof(SocketClosed)), "{time}: Connection Id {connectionId}: Socket closed.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, WebSocketCloseStatus?, string, Exception> _clientClosed =
|
||||
LoggerMessage.Define<DateTime, string, WebSocketCloseStatus?, string>(LogLevel.Debug, new EventId(2, nameof(ClientClosed)), "{time}: Connection Id {connectionId}: Client closed connection with status code '{status}' ({description}). Signaling end-of-input to application..");
|
||||
LoggerMessage.Define<DateTime, string, WebSocketCloseStatus?, string>(LogLevel.Debug, new EventId(3, nameof(ClientClosed)), "{time}: Connection Id {connectionId}: Client closed connection with status code '{status}' ({description}). Signaling end-of-input to application.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _waitingForSend =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(3, nameof(WaitingForSend)), "{time}: Connection Id {connectionId}: Waiting for the application to finish sending data.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(WaitingForSend)), "{time}: Connection Id {connectionId}: Waiting for the application to finish sending data.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _failedSending =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(4, nameof(FailedSending)), "{time}: Connection Id {connectionId}: Application failed during sending. Sending InternalServerError close frame.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(5, nameof(FailedSending)), "{time}: Connection Id {connectionId}: Application failed during sending. Sending InternalServerError close frame.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _finishedSending =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(5, nameof(FinishedSending)), "{time}: Connection Id {connectionId}: Application finished sending. Sending close frame.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(6, nameof(FinishedSending)), "{time}: Connection Id {connectionId}: Application finished sending. Sending close frame.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _waitingForClose =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(6, nameof(WaitingForClose)), "{time}: Connection Id {connectionId}: Waiting for the client to close the socket.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(7, nameof(WaitingForClose)), "{time}: Connection Id {connectionId}: Waiting for the client to close the socket.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _closeTimedOut =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(7, nameof(CloseTimedOut)), "{time}: Connection Id {connectionId}: Timed out waiting for client to send the close frame, aborting the connection.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(8, nameof(CloseTimedOut)), "{time}: Connection Id {connectionId}: Timed out waiting for client to send the close frame, aborting the connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, WebSocketMessageType, int, bool, Exception> _messageReceived =
|
||||
LoggerMessage.Define<DateTime, string, WebSocketMessageType, int, bool>(LogLevel.Debug, new EventId(8, nameof(MessageReceived)), "{time}: Connection Id {connectionId}: Message received. Type: {messageType}, size: {size}, EndOfMessage: {endOfMessage}.");
|
||||
LoggerMessage.Define<DateTime, string, WebSocketMessageType, int, bool>(LogLevel.Debug, new EventId(9, nameof(MessageReceived)), "{time}: Connection Id {connectionId}: Message received. Type: {messageType}, size: {size}, EndOfMessage: {endOfMessage}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _messageToApplication =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(9, nameof(MessageToApplication)), "{time}: Connection Id {connectionId}: Passing message to application. Payload size: {size}.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(10, nameof(MessageToApplication)), "{time}: Connection Id {connectionId}: Passing message to application. Payload size: {size}.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _sendPayload =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(10, nameof(SendPayload)), "{time}: Connection Id {connectionId}: Sending payload: {size} bytes.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(11, nameof(SendPayload)), "{time}: Connection Id {connectionId}: Sending payload: {size} bytes.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _errorWritingFrame =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(11, nameof(ErrorWritingFrame)), "{time}: Connection Id {connectionId}: Error writing frame.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(12, nameof(ErrorWritingFrame)), "{time}: Connection Id {connectionId}: Error writing frame.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _sendFailed =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(12, nameof(SendFailed)), "{time}: Connection Id {connectionId}: Socket failed to send.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(13, nameof(SendFailed)), "{time}: Connection Id {connectionId}: Socket failed to send.");
|
||||
|
||||
// Category: ServerSentEventsTransport
|
||||
private static readonly Action<ILogger, DateTime, string, int, Exception> _sseWritingMessage =
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(0, nameof(SSEWritingMessage)), "{time}: Connection Id {connectionId}: Writing a {count} byte message.");
|
||||
LoggerMessage.Define<DateTime, string, int>(LogLevel.Debug, new EventId(1, nameof(SSEWritingMessage)), "{time}: Connection Id {connectionId}: Writing a {count} byte message.");
|
||||
|
||||
public static void LongPolling204(this ILogger logger, string connectionId, string requestId)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,25 +10,25 @@ namespace Microsoft.AspNetCore.Sockets.Internal
|
|||
{
|
||||
// Category: ConnectionManager
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _createdNewConnection =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(0, nameof(CreatedNewConnection)), "{time}: ConnectionId {connectionId}: New connection created.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(1, nameof(CreatedNewConnection)), "{time}: ConnectionId {connectionId}: New connection created.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _removedConnection =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(1, nameof(RemovedConnection)), "{time}: ConnectionId {connectionId}: Removing connection from the list of connections.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Debug, new EventId(2, nameof(RemovedConnection)), "{time}: ConnectionId {connectionId}: Removing connection from the list of connections.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _failedDispose =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(2, nameof(FailedDispose)), "{time}: ConnectionId {connectionId}: Failed disposing connection.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Error, new EventId(3, nameof(FailedDispose)), "{time}: ConnectionId {connectionId}: Failed disposing connection.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _connectionReset =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(3, nameof(ConnectionReset)), "{time}: ConnectionId {connectionId}: Connection was reset.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(4, nameof(ConnectionReset)), "{time}: ConnectionId {connectionId}: Connection was reset.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, string, Exception> _connectionTimedOut =
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(4, nameof(ConnectionTimedOut)), "{time}: ConnectionId {connectionId}: Connection timed out.");
|
||||
LoggerMessage.Define<DateTime, string>(LogLevel.Trace, new EventId(5, nameof(ConnectionTimedOut)), "{time}: ConnectionId {connectionId}: Connection timed out.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, Exception> _scanningConnections =
|
||||
LoggerMessage.Define<DateTime>(LogLevel.Trace, new EventId(5, nameof(ScanningConnections)), "{time}: Scanning connections.");
|
||||
LoggerMessage.Define<DateTime>(LogLevel.Trace, new EventId(6, nameof(ScanningConnections)), "{time}: Scanning connections.");
|
||||
|
||||
private static readonly Action<ILogger, DateTime, TimeSpan, Exception> _scannedConnections =
|
||||
LoggerMessage.Define<DateTime, TimeSpan>(LogLevel.Trace, new EventId(6, nameof(ScannedConnections)), "{time}: Scanned connections in {duration}.");
|
||||
LoggerMessage.Define<DateTime, TimeSpan>(LogLevel.Trace, new EventId(7, nameof(ScannedConnections)), "{time}: Scanned connections in {duration}.");
|
||||
|
||||
public static void CreatedNewConnection(this ILogger logger, string connectionId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue