Skip to content

Commit 7b00854

Browse files
committed
Use skipEnabledCheck in Servers/Kestrel
1 parent f442717 commit 7b00854

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelTrace.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ internal class KestrelTrace : IKestrelTrace
5959
LoggerMessage.Define<string>(LogLevel.Warning, new EventId(24, "ConnectionRejected"), @"Connection id ""{ConnectionId}"" rejected because the maximum number of concurrent connections has been reached.");
6060

6161
private static readonly Action<ILogger, string, string, Exception?> _requestBodyStart =
62-
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(25, "RequestBodyStart"), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": started reading request body.");
62+
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(25, "RequestBodyStart"), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": started reading request body.", skipEnabledCheck: true);
6363

6464
private static readonly Action<ILogger, string, string, Exception?> _requestBodyDone =
65-
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(26, "RequestBodyDone"), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": done reading request body.");
65+
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(26, "RequestBodyDone"), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": done reading request body.", skipEnabledCheck: true);
6666

6767
private static readonly Action<ILogger, string, string?, double, Exception?> _requestBodyMinimumDataRateNotSatisfied =
6868
LoggerMessage.Define<string, string?, double>(LogLevel.Debug, new EventId(27, "RequestBodyMinimumDataRateNotSatisfied"), @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the request timed out because it was not sent by the client at a minimum of {Rate} bytes/second.");
@@ -102,11 +102,13 @@ internal class KestrelTrace : IKestrelTrace
102102

103103
private static readonly Action<ILogger, string, Http2FrameType, int, int, object, Exception?> _http2FrameReceived =
104104
LoggerMessage.Define<string, Http2FrameType, int, int, object>(LogLevel.Trace, new EventId(37, "Http2FrameReceived"),
105-
@"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length} and flags {flags}.");
105+
@"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length} and flags {flags}.",
106+
skipEnabledCheck: true);
106107

107108
private static readonly Action<ILogger, string, Http2FrameType, int, int, object, Exception?> _http2FrameSending =
108109
LoggerMessage.Define<string, Http2FrameType, int, int, object>(LogLevel.Trace, new EventId(49, "Http2FrameSending"),
109-
@"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length} and flags {flags}.");
110+
@"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length} and flags {flags}.",
111+
skipEnabledCheck: true);
110112

111113
private static readonly Action<ILogger, string, int, Exception> _hpackEncodingError =
112114
LoggerMessage.Define<string, int>(LogLevel.Information, new EventId(38, "HPackEncodingError"),
@@ -136,15 +138,18 @@ internal class KestrelTrace : IKestrelTrace
136138

137139
private static readonly Action<ILogger, string, string, Exception> _http3StreamAbort =
138140
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(45, "Http3StreamAbort"),
139-
@"Trace id ""{TraceIdentifier}"": HTTP/3 stream error ""{error}"". An abort is being sent to the stream.");
141+
@"Trace id ""{TraceIdentifier}"": HTTP/3 stream error ""{error}"". An abort is being sent to the stream.",
142+
skipEnabledCheck: true);
140143

141144
private static readonly Action<ILogger, string, string, long, long, Exception?> _http3FrameReceived =
142145
LoggerMessage.Define<string, string, long, long>(LogLevel.Trace, new EventId(46, "Http3FrameReceived"),
143-
@"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length}.");
146+
@"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length}.",
147+
skipEnabledCheck: true);
144148

145149
private static readonly Action<ILogger, string, string, long, long, Exception?> _http3FrameSending =
146150
LoggerMessage.Define<string, string, long, long>(LogLevel.Trace, new EventId(47, "Http3FrameSending"),
147-
@"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length}.");
151+
@"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length}.",
152+
skipEnabledCheck: true);
148153

149154
protected readonly ILogger _logger;
150155

0 commit comments

Comments
 (0)