3498 references to LogLevel
Aspire.Confluent.Kafka (3)
Aspire.Dashboard (62)
Components\Pages\StructuredLogs.razor.cs (18)
37private List<SelectViewModel<LogLevel?>> _logLevels = default!;
168_logLevels = new List<SelectViewModel<LogLevel?>>
170new SelectViewModel<LogLevel?> { Id = null, Name = ControlsStringsLoc[nameof(Dashboard.Resources.ControlsStrings.LabelAll)] },
171new SelectViewModel<LogLevel?> { Id = LogLevel.Trace, Name = "Trace" },
172new SelectViewModel<LogLevel?> { Id = LogLevel.Debug, Name = "Debug" },
173new SelectViewModel<LogLevel?> { Id = LogLevel.Information, Name = "Information" },
174new SelectViewModel<LogLevel?> { Id = LogLevel.Warning, Name = "Warning" },
175new SelectViewModel<LogLevel?> { Id = LogLevel.Error, Name = "Error" },
176new SelectViewModel<LogLevel?> { Id = LogLevel.Critical, Name = "Critical" },
400if (LogLevelText is not null && Enum.TryParse<LogLevel>(LogLevelText, ignoreCase: true, out var logLevel))
431public SelectViewModel<LogLevel?> SelectedLogLevel { get; set; } = default!;
Otlp\Model\OtlpLogEntry.cs (27)
16public LogLevel Severity { get; }
66private static LogLevel MapSeverity(SeverityNumber severityNumber) => severityNumber switch
68SeverityNumber.Trace => LogLevel.Trace,
69SeverityNumber.Trace2 => LogLevel.Trace,
70SeverityNumber.Trace3 => LogLevel.Trace,
71SeverityNumber.Trace4 => LogLevel.Trace,
72SeverityNumber.Debug => LogLevel.Debug,
73SeverityNumber.Debug2 => LogLevel.Debug,
74SeverityNumber.Debug3 => LogLevel.Debug,
75SeverityNumber.Debug4 => LogLevel.Debug,
76SeverityNumber.Info => LogLevel.Information,
77SeverityNumber.Info2 => LogLevel.Information,
78SeverityNumber.Info3 => LogLevel.Information,
79SeverityNumber.Info4 => LogLevel.Information,
80SeverityNumber.Warn => LogLevel.Warning,
81SeverityNumber.Warn2 => LogLevel.Warning,
82SeverityNumber.Warn3 => LogLevel.Warning,
83SeverityNumber.Warn4 => LogLevel.Warning,
84SeverityNumber.Error => LogLevel.Error,
85SeverityNumber.Error2 => LogLevel.Error,
86SeverityNumber.Error3 => LogLevel.Error,
87SeverityNumber.Error4 => LogLevel.Error,
88SeverityNumber.Fatal => LogLevel.Critical,
89SeverityNumber.Fatal2 => LogLevel.Critical,
90SeverityNumber.Fatal3 => LogLevel.Critical,
91SeverityNumber.Fatal4 => LogLevel.Critical,
92_ => LogLevel.None
Aspire.Dashboard.Components.Tests (24)
tests\Shared\Logging\TestLogger.cs (5)
11private readonly Func<LogLevel, bool> _filter;
18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
57public bool IsEnabled(LogLevel logLevel)
59return logLevel != LogLevel.None && _filter(logLevel);
tests\Shared\Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
tests\Shared\Logging\XunitLoggerProvider.cs (8)
13private readonly LogLevel _minLevel;
17: this(output, LogLevel.Trace)
21public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
26public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
47private readonly LogLevel _minLogLevel;
51public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114public bool IsEnabled(LogLevel logLevel)
Aspire.Dashboard.Tests (40)
tests\Shared\Logging\TestLogger.cs (5)
11private readonly Func<LogLevel, bool> _filter;
18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
57public bool IsEnabled(LogLevel logLevel)
59return logLevel != LogLevel.None && _filter(logLevel);
tests\Shared\Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
tests\Shared\Logging\XunitLoggerProvider.cs (8)
13private readonly LogLevel _minLevel;
17: this(output, LogLevel.Trace)
21public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
26public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
47private readonly LogLevel _minLogLevel;
51public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114public bool IsEnabled(LogLevel logLevel)
Aspire.Hosting (35)
ApplicationModel\ResourceLoggerService.cs (5)
110public bool IsEnabled(LogLevel logLevel)
116public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
538bool ILogger.IsEnabled(LogLevel logLevel) => true;
540public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
551var isErrorMessage = logLevel >= LogLevel.Error;
Aspire.Hosting.Azure (1)
Aspire.Hosting.Containers.Tests (3)
Aspire.Hosting.Testing (3)
Aspire.Hosting.Testing.Tests (28)
ResourceLoggerForwarderServiceTests.cs (6)
119log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("1: 2000-12-29T20:59:59.0000000Z Test trace message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
120log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("2: 2000-12-29T20:59:59.0000000Z Test debug message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
121log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("3: 2000-12-29T20:59:59.0000000Z Test information message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
122log => { Assert.Equal(LogLevel.Information, log.Level); Assert.Equal("4: 2000-12-29T20:59:59.0000000Z Test warning message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
123log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("5: 2000-12-29T20:59:59.0000000Z Test error message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); },
124log => { Assert.Equal(LogLevel.Error, log.Level); Assert.Equal("6: 2000-12-29T20:59:59.0000000Z Test critical message", log.Message); Assert.Equal("TestApp.AppHost.Resources.myresource", log.Category); });
tests\Shared\Logging\TestLogger.cs (5)
11private readonly Func<LogLevel, bool> _filter;
18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
57public bool IsEnabled(LogLevel logLevel)
59return logLevel != LogLevel.None && _filter(logLevel);
tests\Shared\Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
tests\Shared\Logging\XunitLoggerProvider.cs (8)
13private readonly LogLevel _minLevel;
17: this(output, LogLevel.Trace)
21public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
26public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
47private readonly LogLevel _minLogLevel;
51public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114public bool IsEnabled(LogLevel logLevel)
Aspire.Hosting.Tests (62)
ResourceNotificationTests.cs (17)
307Assert.Single(logs.Where(l => l.Level == LogLevel.Debug));
308Assert.Contains(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state: SomeState"));
317Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug);
318Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state: SomeState"));
327Assert.Single(logs.Where(l => l.Level == LogLevel.Debug));
328Assert.Contains(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state: SomeState -> NewState"));
337Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug);
338Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state:"));
347Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug);
348Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state:"));
357Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug);
358Assert.DoesNotContain(logs, l => l.Level == LogLevel.Debug && l.Message.Contains("Resource resource1/resource1 changed state:"));
377Assert.Single(logs.Where(l => l.Level == LogLevel.Debug));
378Assert.Equal(3, logs.Where(l => l.Level == LogLevel.Trace).Count());
379Assert.Contains(logs, l => l.Level == LogLevel.Trace && l.Message.Contains("Resource resource1/resource1 update published:") && l.Message.Contains($"CreationTimeStamp = {createdDate:s}"));
380Assert.Contains(logs, l => l.Level == LogLevel.Trace && l.Message.Contains("Resource resource1/resource1 update published:") && l.Message.Contains("State = { Text = SomeState"));
381Assert.Contains(logs, l => l.Level == LogLevel.Trace && l.Message.Contains("Resource resource1/resource1 update published:") && l.Message.Contains("ExitCode = 0"));
tests\Shared\Logging\TestLogger.cs (5)
11private readonly Func<LogLevel, bool> _filter;
18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
57public bool IsEnabled(LogLevel logLevel)
59return logLevel != LogLevel.None && _filter(logLevel);
tests\Shared\Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
tests\Shared\Logging\XunitLoggerProvider.cs (8)
13private readonly LogLevel _minLevel;
17: this(output, LogLevel.Trace)
21public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
26public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
47private readonly LogLevel _minLogLevel;
51public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114public bool IsEnabled(LogLevel logLevel)
Aspire.Playground.Tests (27)
tests\Shared\Logging\TestLogger.cs (5)
11private readonly Func<LogLevel, bool> _filter;
18public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
38public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
57public bool IsEnabled(LogLevel logLevel)
59return logLevel != LogLevel.None && _filter(logLevel);
tests\Shared\Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
tests\Shared\Logging\XunitLoggerProvider.cs (8)
13private readonly LogLevel _minLevel;
17: this(output, LogLevel.Trace)
21public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
26public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
47private readonly LogLevel _minLogLevel;
51public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
60LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114public bool IsEnabled(LogLevel logLevel)
Aspire.RabbitMQ.Client (8)
Aspire.RabbitMQ.Client.Tests (9)
AspireRabbitMQLoggingTests.cs (9)
67Assert.Contains(logs, l => l.Level == LogLevel.Information && l.Message == "Performing automatic recovery");
68Assert.Contains(logs, l => l.Level == LogLevel.Error && l.Message == "Connection recovery exception.");
88Assert.Equal(LogLevel.Information, logs[0].Level);
96Assert.Equal(LogLevel.Warning, logs[1].Level);
129Assert.Equal(LogLevel.Error, logs[0].Level);
175Assert.Equal(LogLevel.Error, logs[0].Level);
203public BlockingCollection<(LogLevel Level, string Message, object? State)> Logs { get; } = new();
209public bool IsEnabled(LogLevel logLevel) => true;
211public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
BasicLinkedApp (1)
BasicTestApp (2)
BuildValidator (7)
DemoLogger.cs (4)
40public bool IsEnabled(LogLevel logLevel) => true;
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
71public bool IsEnabled(LogLevel logLevel) => false;
73public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
ClientSample (1)
CookiePolicySample (1)
CookieSessionSample (1)
CustomEncryptorSample (1)
Diagnostics.EFCore.FunctionalTests (2)
EntityFrameworkCoreSample (1)
EventHubsConsumer (1)
HealthChecksSample (1)
HostFilteringSample (1)
http2cat (3)
Http2SampleApp (1)
Http3SampleApp (1)
HttpsPolicySample (1)
HttpStress (1)
IIS.FunctionalTests (5)
IIS.LongTests (5)
IIS.NewHandler.FunctionalTests (5)
IIS.NewShim.FunctionalTests (5)
IIS.ShadowCopy.Tests (2)
IIS.Tests (3)
IISExpress.FunctionalTests (5)
IISSample (1)
InMemory.FunctionalTests (61)
HttpsTests.cs (11)
191Assert.Equal(LogLevel.Debug, loggerProvider.FilterLogger.LastLogLevel);
220Assert.Equal(LogLevel.Debug, loggerProvider.FilterLogger.LastLogLevel);
389Assert.Equal(LogLevel.Debug, loggerProvider.FilterLogger.LastLogLevel);
423Assert.Equal(LogLevel.Debug, loggerProvider.FilterLogger.LastLogLevel);
707Assert.Equal(LogLevel.Debug, loggerProvider.FilterLogger.LastLogLevel);
820public LogLevel LastLogLevel { get; set; }
824public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
834public bool IsEnabled(LogLevel logLevel)
852public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
854if (logLevel == LogLevel.Error)
871public bool IsEnabled(LogLevel logLevel)
ResponseTests.cs (20)
510Assert.Contains(TestSink.Writes, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
982var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
1021var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
1061var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
1096var logMessage = Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
1294var error = LogMessages.Where(message => message.LogLevel == LogLevel.Error);
1332Assert.DoesNotContain(LogMessages, message => message.LogLevel == LogLevel.Error);
1368Assert.DoesNotContain(LogMessages, message => message.LogLevel == LogLevel.Error);
1404Assert.DoesNotContain(LogMessages, message => message.LogLevel == LogLevel.Error);
2028Assert.Contains(LogMessages, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
2082if (message.EventId.Id == 17 && message.LogLevel <= LogLevel.Debug && message.Exception is BadHttpRequestException
2145Assert.Contains(LogMessages, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
2464Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count());
2524Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count());
2664Assert.Equal(2, LogMessages.Where(message => message.LogLevel == LogLevel.Error).Count());
2711Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
2756Assert.Single(LogMessages, message => message.LogLevel == LogLevel.Error);
2789Assert.DoesNotContain(LogMessages, message => message.LogLevel == LogLevel.Error);
4133Assert.Contains(TestSink.Writes, w => w.EventId.Id == 13 && w.LogLevel == LogLevel.Error
4764Assert.Contains(testSink.Writes, w => w.EventId.Id == 17 && w.LogLevel <= LogLevel.Debug && w.Exception is BadHttpRequestException
InProcessWebSite (2)
Interop.FunctionalTests (5)
InteropClient (1)
InteropWebsite (1)
JwtSample (1)
Kestrel.SampleApp (1)
LocalizationWebsite (1)
Microsoft.Arcade.Common (16)
CompactConsoleLoggerFormatter.cs (16)
46_messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length + (_options.TimestampFormat?.Length ?? 0));
63LogLevel logLevel = logEntry.LogLevel;
104private static string GetLogLevelString(LogLevel logLevel) => logLevel switch
106LogLevel.Trace => "trce",
107LogLevel.Debug => "dbug",
108LogLevel.Information => "info",
109LogLevel.Warning => "warn",
110LogLevel.Error => "fail",
111LogLevel.Critical => "crit",
115private (ConsoleColor? Foreground, ConsoleColor? Background) GetLogLevelConsoleColors(LogLevel logLevel)
126LogLevel.Trace => (ConsoleColor.Gray, ConsoleColor.Black),
127LogLevel.Debug => (ConsoleColor.Gray, ConsoleColor.Black),
128LogLevel.Information => (ConsoleColor.DarkGreen, ConsoleColor.Black),
129LogLevel.Warning => (ConsoleColor.Yellow, ConsoleColor.Black),
130LogLevel.Error => (ConsoleColor.Black, ConsoleColor.DarkRed),
131LogLevel.Critical => (ConsoleColor.White, ConsoleColor.DarkRed),
Microsoft.AspNetCore.Antiforgery (9)
Internal\AntiforgeryLoggerExtensions.cs (9)
10[LoggerMessage(1, LogLevel.Warning, "Antiforgery validation failed with message '{Message}'.", EventName = "ValidationFailed")]
13[LoggerMessage(2, LogLevel.Debug, "Antiforgery successfully validated a request.", EventName = "Validated")]
16[LoggerMessage(3, LogLevel.Warning, "The required antiforgery cookie '{CookieName}' is not present.", EventName = "MissingCookieToken")]
19[LoggerMessage(4, LogLevel.Warning, "The required antiforgery request token was not provided in either form field '{FormFieldName}' "
23[LoggerMessage(5, LogLevel.Debug, "A new antiforgery cookie token was created.", EventName = "NewCookieToken")]
26[LoggerMessage(6, LogLevel.Debug, "An antiforgery cookie token was reused.", EventName = "ReusedCookieToken")]
29[LoggerMessage(7, LogLevel.Error, "An exception was thrown while deserializing the token.", EventName = "TokenDeserializeException")]
32[LoggerMessage(8, LogLevel.Warning, "The 'Cache-Control' and 'Pragma' headers have been overridden and set to 'no-cache, no-store' and " +
37[LoggerMessage(9, LogLevel.Debug, "Failed to deserialize antiforgery tokens.", EventName = "FailedToDeserialzeTokens")]
Microsoft.AspNetCore.Antiforgery.Test (7)
Microsoft.AspNetCore.Authentication (14)
LoggingExtensions.cs (14)
8[LoggerMessage(4, LogLevel.Information, "Error from RemoteAuthentication: {ErrorMessage}.", EventName = "RemoteAuthenticationFailed")]
11[LoggerMessage(5, LogLevel.Debug, "The SigningIn event returned Handled.", EventName = "SignInHandled")]
14[LoggerMessage(6, LogLevel.Debug, "The SigningIn event returned Skipped.", EventName = "SignInSkipped")]
17[LoggerMessage(7, LogLevel.Information, "{AuthenticationScheme} was not authenticated. Failure message: {FailureMessage}", EventName = "AuthenticationSchemeNotAuthenticatedWithFailure")]
20[LoggerMessage(8, LogLevel.Debug, "AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.", EventName = "AuthenticationSchemeAuthenticated")]
23[LoggerMessage(9, LogLevel.Debug, "AuthenticationScheme: {AuthenticationScheme} was not authenticated.", EventName = "AuthenticationSchemeNotAuthenticated")]
26[LoggerMessage(12, LogLevel.Information, "AuthenticationScheme: {AuthenticationScheme} was challenged.", EventName = "AuthenticationSchemeChallenged")]
29[LoggerMessage(13, LogLevel.Information, "AuthenticationScheme: {AuthenticationScheme} was forbidden.", EventName = "AuthenticationSchemeForbidden")]
32[LoggerMessage(14, LogLevel.Warning, "{CorrelationProperty} state property not found.", EventName = "CorrelationPropertyNotFound")]
35[LoggerMessage(15, LogLevel.Warning, "'{CorrelationCookieName}' cookie not found.", EventName = "CorrelationCookieNotFound")]
38[LoggerMessage(16, LogLevel.Warning, "The correlation cookie value '{CorrelationCookieName}' did not match the expected value '{CorrelationCookieValue}'.", EventName = "UnexpectedCorrelationCookieValue")]
41[LoggerMessage(17, LogLevel.Information, "Access was denied by the resource owner or by the remote server.", EventName = "AccessDenied")]
44[LoggerMessage(18, LogLevel.Debug, "The AccessDenied event returned Handled.", EventName = "AccessDeniedContextHandled")]
47[LoggerMessage(19, LogLevel.Debug, "The AccessDenied event returned Skipped.", EventName = "AccessDeniedContextSkipped")]
Microsoft.AspNetCore.Authentication.BearerToken (1)
Microsoft.AspNetCore.Authentication.Certificate (4)
LoggingExtensions.cs (4)
8[LoggerMessage(0, LogLevel.Debug, "No client certificate found.", EventName = "NoCertificate")]
11[LoggerMessage(3, LogLevel.Debug, "Not https, skipping certificate authentication.", EventName = "NotHttps")]
14[LoggerMessage(1, LogLevel.Warning, "{CertificateType} certificate rejected, subject was {Subject}.", EventName = "CertificateRejected")]
17[LoggerMessage(2, LogLevel.Warning, "Certificate validation failed, subject was {Subject}. {ChainErrors}", EventName = "CertificateFailedValidation")]
Microsoft.AspNetCore.Authentication.Cookies (2)
Microsoft.AspNetCore.Authentication.JwtBearer (4)
LoggingExtensions.cs (4)
8[LoggerMessage(1, LogLevel.Information, "Failed to validate the token.", EventName = "TokenValidationFailed")]
11[LoggerMessage(2, LogLevel.Debug, "Successfully validated the token.", EventName = "TokenValidationSucceeded")]
14[LoggerMessage(3, LogLevel.Error, "Exception occurred while processing message.", EventName = "ProcessingMessageFailed")]
17[LoggerMessage(4, LogLevel.Debug, "Unable to reject the response as forbidden, it has already started.", EventName = "ForbiddenResponseHasStarted")]
Microsoft.AspNetCore.Authentication.Negotiate (15)
Internal\NegotiateLoggingExtensions.cs (12)
8[LoggerMessage(1, LogLevel.Information, "Incomplete Negotiate handshake, sending an additional 401 Negotiate challenge.", EventName = "IncompleteNegotiateChallenge")]
11[LoggerMessage(2, LogLevel.Debug, "Completed Negotiate authentication.", EventName = "NegotiateComplete")]
14[LoggerMessage(3, LogLevel.Debug, "Enabling credential persistence for a complete Kerberos handshake.", EventName = "EnablingCredentialPersistence")]
17[LoggerMessage(4, LogLevel.Debug, "Disabling credential persistence for a complete {protocol} handshake.", EventName = "DisablingCredentialPersistence")]
20[LoggerMessage(5, LogLevel.Error, "An exception occurred while processing the authentication request.", EventName = "ExceptionProcessingAuth")]
23[LoggerMessage(6, LogLevel.Debug, "Challenged 401 Negotiate.", EventName = "ChallengeNegotiate")]
26[LoggerMessage(7, LogLevel.Debug, "Negotiate data received for an already authenticated connection, Re-authenticating.", EventName = "Reauthenticating")]
29[LoggerMessage(8, LogLevel.Information, "Deferring to the server's implementation of Windows Authentication.", EventName = "Deferring")]
32[LoggerMessage(9, LogLevel.Debug, "There was a problem with the users credentials.", EventName = "CredentialError")]
35[LoggerMessage(10, LogLevel.Debug, "The users authentication request was invalid.", EventName = "ClientError")]
38[LoggerMessage(11, LogLevel.Debug, "Negotiate error code: {error}.", EventName = "NegotiateError")]
41[LoggerMessage(12, LogLevel.Debug, "Negotiate is not supported with {protocol}.", EventName = "ProtocolNotSupported")]
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (58)
LoggingExtensions.cs (57)
8[LoggerMessage(13, LogLevel.Debug, "Updating configuration", EventName = "UpdatingConfiguration")]
11[LoggerMessage(18, LogLevel.Debug, "Exception of type 'SecurityTokenSignatureKeyNotFoundException' thrown, Options.ConfigurationManager.RequestRefresh() called.", EventName = "ConfigurationManagerRequestRefreshCalled")]
14[LoggerMessage(27, LogLevel.Trace, "Authorization code received.", EventName = "AuthorizationCodeReceived")]
17[LoggerMessage(30, LogLevel.Trace, "Token response received.", EventName = "TokenResponseReceived")]
20[LoggerMessage(21, LogLevel.Debug, "Received 'id_token'", EventName = "ReceivedIdToken")]
23[LoggerMessage(19, LogLevel.Debug, "Redeeming code for tokens.", EventName = "RedeemingCodeForTokens")]
26[LoggerMessage(15, LogLevel.Debug, "TokenValidated.HandledResponse", EventName = "TokenValidatedHandledResponse")]
29[LoggerMessage(16, LogLevel.Debug, "TokenValidated.Skipped", EventName = "TokenValidatedSkipped")]
32[LoggerMessage(28, LogLevel.Debug, "AuthorizationCodeReceivedContext.HandledResponse", EventName = "AuthorizationCodeReceivedContextHandledResponse")]
35[LoggerMessage(29, LogLevel.Debug, "AuthorizationCodeReceivedContext.Skipped", EventName = "AuthorizationCodeReceivedContextSkipped")]
38[LoggerMessage(31, LogLevel.Debug, "TokenResponseReceived.HandledResponse", EventName = "TokenResponseReceivedHandledResponse")]
41[LoggerMessage(32, LogLevel.Debug, "TokenResponseReceived.Skipped", EventName = "TokenResponseReceivedSkipped")]
44[LoggerMessage(38, LogLevel.Debug, "AuthenticationFailedContext.HandledResponse", EventName = "AuthenticationFailedContextHandledResponse")]
47[LoggerMessage(39, LogLevel.Debug, "AuthenticationFailedContext.Skipped", EventName = "AuthenticationFailedContextSkipped")]
50[LoggerMessage(24, LogLevel.Trace, "MessageReceived: '{RedirectUrl}'.", EventName = "MessageReceived")]
53[LoggerMessage(25, LogLevel.Debug, "MessageReceivedContext.HandledResponse", EventName = "MessageReceivedContextHandledResponse")]
56[LoggerMessage(26, LogLevel.Debug, "MessageReceivedContext.Skipped", EventName = "MessageReceivedContextSkipped")]
59[LoggerMessage(1, LogLevel.Debug, "RedirectToIdentityProviderForSignOut.HandledResponse", EventName = "RedirectToIdentityProviderForSignOutHandledResponse")]
62[LoggerMessage(6, LogLevel.Debug, "RedirectToIdentityProvider.HandledResponse", EventName = "RedirectToIdentityProviderHandledResponse")]
65[LoggerMessage(50, LogLevel.Debug, "RedirectToSignedOutRedirectUri.HandledResponse", EventName = "SignOutCallbackRedirectHandledResponse")]
68[LoggerMessage(51, LogLevel.Debug, "RedirectToSignedOutRedirectUri.Skipped", EventName = "SignOutCallbackRedirectSkipped")]
71[LoggerMessage(36, LogLevel.Debug, "The UserInformationReceived event returned Handled.", EventName = "UserInformationReceivedHandledResponse")]
74[LoggerMessage(37, LogLevel.Debug, "The UserInformationReceived event returned Skipped.", EventName = "UserInformationReceivedSkipped")]
77[LoggerMessage(57, LogLevel.Debug, "The PushAuthorization event handled client authentication", EventName = "PushAuthorizationHandledClientAuthentication")]
80[LoggerMessage(58, LogLevel.Debug, "The PushAuthorization event handled pushing authorization", EventName = "PushAuthorizationHandledPush")]
83[LoggerMessage(59, LogLevel.Debug, "The PushAuthorization event skipped pushing authorization", EventName = "PushAuthorizationSkippedPush")]
86[LoggerMessage(3, LogLevel.Warning, "The query string for Logout is not a well-formed URI. Redirect URI: '{RedirectUrl}'.", EventName = "InvalidLogoutQueryStringRedirectUrl")]
89[LoggerMessage(10, LogLevel.Debug, "message.State is null or empty.", EventName = "NullOrEmptyAuthorizationResponseState")]
92[LoggerMessage(11, LogLevel.Debug, "Unable to read the message.State.", EventName = "UnableToReadAuthorizationResponseState")]
95[LoggerMessage(12, LogLevel.Error, "Message contains error: '{Error}', error_description: '{ErrorDescription}', error_uri: '{ErrorUri}'.", EventName = "ResponseError")]
98[LoggerMessage(52, LogLevel.Error, "Message contains error: '{Error}', error_description: '{ErrorDescription}', error_uri: '{ErrorUri}', status code '{StatusCode}'.", EventName = "ResponseErrorWithStatusCode")]
101[LoggerMessage(17, LogLevel.Error, "Exception occurred while processing message.", EventName = "ExceptionProcessingMessage")]
104[LoggerMessage(42, LogLevel.Debug, "The access_token is not available. Claims cannot be retrieved.", EventName = "AccessTokenNotAvailable")]
107[LoggerMessage(20, LogLevel.Trace, "Retrieving claims from the user info endpoint.", EventName = "RetrievingClaims")]
110[LoggerMessage(22, LogLevel.Debug, "UserInfoEndpoint is not set. Claims cannot be retrieved.", EventName = "UserInfoEndpointNotSet")]
113[LoggerMessage(23, LogLevel.Warning, "Failed to un-protect the nonce cookie.", EventName = "UnableToProtectNonceCookie")]
116[LoggerMessage(8, LogLevel.Warning, "The redirect URI is not well-formed. The URI is: '{AuthenticationRequestUrl}'.", EventName = "InvalidAuthenticationRequestUrl")]
119[LoggerMessage(43, LogLevel.Error, "Unable to read the 'id_token', no suitable ISecurityTokenValidator was found for: '{IdToken}'.", EventName = "UnableToReadIdToken")]
122[LoggerMessage(40, LogLevel.Error, "The Validated Security Token must be of type JwtSecurityToken, but instead its type is: '{SecurityTokenType}'", EventName = "InvalidSecurityTokenType")]
125[LoggerMessage(41, LogLevel.Error, "Unable to validate the 'id_token', no suitable ISecurityTokenValidator was found for: '{IdToken}'.", EventName = "UnableToValidateIdToken")]
128[LoggerMessage(9, LogLevel.Trace, "Entering {OpenIdConnectHandlerType}'s HandleRemoteAuthenticateAsync.", EventName = "EnteringOpenIdAuthenticationHandlerHandleRemoteAuthenticateAsync")]
131[LoggerMessage(4, LogLevel.Trace, "Entering {OpenIdConnectHandlerType}'s HandleUnauthorizedAsync.", EventName = "EnteringOpenIdAuthenticationHandlerHandleUnauthorizedAsync")]
134[LoggerMessage(14, LogLevel.Trace, "Entering {OpenIdConnectHandlerType}'s HandleSignOutAsync.", EventName = "EnteringOpenIdAuthenticationHandlerHandleSignOutAsync")]
137[LoggerMessage(35, LogLevel.Trace, "User information received: {User}", EventName = "UserInformationReceived")]
140[LoggerMessage(5, LogLevel.Trace, "Using properties.RedirectUri for 'local redirect' post authentication: '{RedirectUri}'.", EventName = "PostAuthenticationLocalRedirect")]
143[LoggerMessage(33, LogLevel.Trace, "Using properties.RedirectUri for redirect post authentication: '{RedirectUri}'.", EventName = "PostSignOutRedirect")]
146[LoggerMessage(44, LogLevel.Debug, "RemoteSignOutContext.HandledResponse", EventName = "RemoteSignOutHandledResponse")]
149[LoggerMessage(45, LogLevel.Debug, "RemoteSignOutContext.Skipped", EventName = "RemoteSignOutSkipped")]
152[LoggerMessage(46, LogLevel.Information, "Remote signout request processed.", EventName = "RemoteSignOut")]
155[LoggerMessage(47, LogLevel.Error, "The remote signout request was ignored because the 'sid' parameter " +
159[LoggerMessage(48, LogLevel.Error, "The remote signout request was ignored because the 'sid' parameter didn't match " +
163[LoggerMessage(49, LogLevel.Information, "AuthenticationScheme: {AuthenticationScheme} signed out.", EventName = "AuthenticationSchemeSignedOut")]
166[LoggerMessage(53, LogLevel.Debug, "HandleChallenge with Location: {Location}; and Set-Cookie: {Cookie}.", EventName = "HandleChallenge")]
169[LoggerMessage(54, LogLevel.Error, "The remote signout request was ignored because the 'iss' parameter " +
173[LoggerMessage(55, LogLevel.Error, "The remote signout request was ignored because the 'iss' parameter didn't match " +
177[LoggerMessage(56, LogLevel.Error, "Unable to validate the 'id_token', no suitable TokenHandler was found for: '{IdToken}'.", EventName = "UnableToValidateIdTokenFromHandler")]
180[LoggerMessage(57, LogLevel.Error, "The Validated Security Token must be of type JsonWebToken, but instead its type is: '{SecurityTokenType}.'", EventName = "InvalidSecurityTokenTypeFromHandler")]
Microsoft.AspNetCore.Authentication.Twitter (3)
Microsoft.AspNetCore.Authentication.WsFederation (7)
LoggingExtensions.cs (7)
8[LoggerMessage(1, LogLevel.Debug, "Received a sign-in message without a WResult.", EventName = "SignInWithoutWResult")]
11[LoggerMessage(2, LogLevel.Debug, "Received a sign-in message without a token.", EventName = "SignInWithoutToken")]
14[LoggerMessage(3, LogLevel.Error, "Exception occurred while processing message.", EventName = "ExceptionProcessingMessage")]
17[LoggerMessage(4, LogLevel.Warning, "The sign-out redirect URI '{uri}' is malformed.", EventName = "MalformedRedirectUri")]
20[LoggerMessage(5, LogLevel.Debug, "RemoteSignOutContext.HandledResponse", EventName = "RemoteSignOutHandledResponse")]
23[LoggerMessage(6, LogLevel.Debug, "RemoteSignOutContext.Skipped", EventName = "RemoteSignOutSkipped")]
26[LoggerMessage(7, LogLevel.Information, "Remote signout request processed.", EventName = "RemoteSignOut")]
Microsoft.AspNetCore.Authorization (2)
Microsoft.AspNetCore.Authorization.Policy (1)
Microsoft.AspNetCore.Authorization.Test (8)
DefaultAuthorizationServiceTests.cs (8)
1160private readonly Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> _assertion;
1162public DefaultAuthorizationServiceTestLogger(Action<LogLevel, EventId, object, Exception, Func<object, Exception, string>> assertion)
1172public bool IsEnabled(LogLevel logLevel)
1177public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
1188static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter)
1190Assert.Equal(LogLevel.Information, level);
1221static void Assertion(LogLevel level, EventId eventId, object state, Exception exception, Func<object, Exception, string> formatter)
1223Assert.Equal(LogLevel.Information, level);
Microsoft.AspNetCore.BrowserTesting (6)
Microsoft.AspNetCore.Components (15)
RenderTree\Renderer.Log.cs (11)
13[LoggerMessage(1, LogLevel.Debug, "Initializing component {ComponentId} ({ComponentType}) as child of {ParentComponentId} ({ParentComponentType})", EventName = "InitializingChildComponent", SkipEnabledCheck = true)]
16[LoggerMessage(2, LogLevel.Debug, "Initializing root component {ComponentId} ({ComponentType})", EventName = "InitializingRootComponent", SkipEnabledCheck = true)]
21if (logger.IsEnabled(LogLevel.Debug)) // This is almost always false, so skip the evaluations
34[LoggerMessage(3, LogLevel.Debug, "Rendering component {ComponentId} of type {ComponentType}", EventName = "RenderingComponent", SkipEnabledCheck = true)]
39if (logger.IsEnabled(LogLevel.Debug)) // This is almost always false, so skip the evaluations
45[LoggerMessage(4, LogLevel.Debug, "Disposing component {ComponentId} of type {ComponentType}", EventName = "DisposingComponent", SkipEnabledCheck = true)]
50if (logger.IsEnabled(LogLevel.Debug)) // This is almost always false, so skip the evaluations
56[LoggerMessage(5, LogLevel.Debug, "Handling event {EventId} of type '{EventType}'", EventName = "HandlingEvent", SkipEnabledCheck = true)]
61if (logger.IsEnabled(LogLevel.Debug)) // This is almost always false, so skip the evaluations
67[LoggerMessage(6, LogLevel.Debug, "Skipping attempt to raise event {EventId} of type '{EventType}' because the component ID {ComponentId} was already disposed", EventName = "SkippingEventOnDisposedComponent", SkipEnabledCheck = true)]
72if (logger.IsEnabled(LogLevel.Debug)) // This is almost always false, so skip the evaluations
Microsoft.AspNetCore.Components.Endpoints (37)
FormMapping\Metadata\FormDataMetadataFactory.cs (27)
163if (_logger.IsEnabled(LogLevel.Debug))
305if (_logger.IsEnabled(LogLevel.Debug))
353[LoggerMessage(1, LogLevel.Debug, "Begin resolve metadata graph for type '{Type}'.", EventName = nameof(StartResolveMetadataGraph))]
356[LoggerMessage(2, LogLevel.Debug, "End resolve metadata graph for type '{Type}'.", EventName = nameof(EndResolveMetadataGraph))]
359[LoggerMessage(3, LogLevel.Debug, "Cached metadata found for type '{Type}'.", EventName = nameof(Metadata))]
362[LoggerMessage(4, LogLevel.Debug, "No cached metadata graph for type '{Type}'.", EventName = nameof(NoMetadataFound))]
365[LoggerMessage(5, LogLevel.Debug, "Recursive type '{Type}' found in the resolution graph '{Chain}'.", EventName = nameof(RecursiveTypeFound))]
368[LoggerMessage(6, LogLevel.Debug, "'{Type}' identified as primitive.", EventName = nameof(PrimitiveType))]
371[LoggerMessage(7, LogLevel.Debug, "'{Type}' identified as dictionary.", EventName = nameof(DictionaryType))]
374[LoggerMessage(8, LogLevel.Debug, "'{Type}' identified as collection.", EventName = nameof(CollectionType))]
377[LoggerMessage(9, LogLevel.Debug, "'{Type}' identified as object.", EventName = nameof(ObjectType))]
380[LoggerMessage(10, LogLevel.Debug, "Constructor found for type '{Type}' with parameters '{Parameters}'.", EventName = nameof(ConstructorFound))]
383[LoggerMessage(11, LogLevel.Debug, "Constructor parameter '{Name}' of type '{ParameterType}' found for type '{Type}'.", EventName = nameof(ConstructorParameter))]
386[LoggerMessage(12, LogLevel.Debug, "Candidate property '{Name}' of type '{PropertyType}'.", EventName = nameof(CandidateProperty))]
389[LoggerMessage(13, LogLevel.Debug, "Candidate property {PropertyName} has a matching constructor parameter '{ConstructorParameterName}'.", EventName = nameof(MatchingConstructorParameterFound))]
392[LoggerMessage(14, LogLevel.Debug, "Candidate property or constructor parameter {PropertyName} defines a custom name '{CustomName}'.", EventName = nameof(CustomParameterNameMetadata))]
395[LoggerMessage(15, LogLevel.Debug, "Candidate property {Name} will not be mapped. It has been explicitly ignored.", EventName = nameof(IgnoredProperty))]
398[LoggerMessage(16, LogLevel.Debug, "Candidate property {Name} will not be mapped. It has no public setter.", EventName = nameof(NonPublicSetter))]
401[LoggerMessage(17, LogLevel.Debug, "Candidate property {Name} is marked as required.", EventName = nameof(PropertyRequired))]
404[LoggerMessage(18, LogLevel.Debug, "Metadata created for {Type}.", EventName = nameof(MetadataComputed))]
407[LoggerMessage(19, LogLevel.Debug, "Can not map type generic type definition '{Type}'.", EventName = nameof(GenericTypeDefinitionNotSupported))]
410[LoggerMessage(20, LogLevel.Debug, "Unable to select a constructor. Multiple public constructors found for type '{Type}'.", EventName = nameof(MultiplePublicConstructorsFound))]
413[LoggerMessage(21, LogLevel.Debug, "Can not map interface type '{Type}'.", EventName = nameof(InterfacesNotSupported))]
416[LoggerMessage(22, LogLevel.Debug, "Can not map abstract type '{Type}'.", EventName = nameof(AbstractClassesNotSupported))]
419[LoggerMessage(23, LogLevel.Debug, "Unable to select a constructor. No public constructors found for type '{Type}'.", EventName = nameof(NoPublicConstructorFound))]
422[LoggerMessage(24, LogLevel.Debug, "Can not map type '{Type}'. Constructor parameter {Name} of type {ParameterType} is not supported.", EventName = nameof(ConstructorParameterTypeNotSupported))]
425[LoggerMessage(25, LogLevel.Debug, "Can not map type '{Type}'. Property {Name} of type {PropertyType} is not supported.", EventName = nameof(PropertyTypeNotSupported))]
RazorComponentEndpointInvoker.cs (7)
280[LoggerMessage(1, LogLevel.Debug, "Begin render root component '{componentType}' with page '{pageType}'.", EventName = nameof(BeginRenderRootComponent))]
283[LoggerMessage(2, LogLevel.Debug, "The antiforgery middleware already failed to validate the current token.", EventName = nameof(MiddlewareAntiforgeryValidationFailed))]
286[LoggerMessage(3, LogLevel.Debug, "The antiforgery middleware already succeeded to validate the current token.", EventName = nameof(MiddlewareAntiforgeryValidationSucceeded))]
289[LoggerMessage(4, LogLevel.Debug, "The endpoint disabled antiforgery token validation.", EventName = nameof(EndpointAntiforgeryValidationDisabled))]
292[LoggerMessage(5, LogLevel.Information, "Antiforgery token validation failed for the current request.", EventName = nameof(EndpointAntiforgeryValidationFailed))]
295[LoggerMessage(6, LogLevel.Debug, "Antiforgery token validation succeeded for the current request.", EventName = nameof(EndpointAntiforgeryValidationSucceeded))]
298[LoggerMessage(7, LogLevel.Debug, "Error handling in progress. Interactive components are not enabled.", EventName = nameof(InteractivityDisabledForErrorHandling))]
Microsoft.AspNetCore.Components.Server (110)
Circuits\CircuitHost.cs (39)
873[LoggerMessage(100, LogLevel.Debug, "Circuit initialization started.", EventName = "InitializationStarted")]
876[LoggerMessage(101, LogLevel.Debug, "Circuit initialization succeeded.", EventName = "InitializationSucceeded")]
879[LoggerMessage(102, LogLevel.Debug, "Circuit initialization failed.", EventName = "InitializationFailed")]
882[LoggerMessage(103, LogLevel.Debug, "Disposing circuit '{CircuitId}' started.", EventName = "DisposeStarted")]
885[LoggerMessage(104, LogLevel.Debug, "Disposing circuit '{CircuitId}' succeeded.", EventName = "DisposeSucceeded")]
888[LoggerMessage(105, LogLevel.Debug, "Disposing circuit '{CircuitId}' failed.", EventName = "DisposeFailed")]
891[LoggerMessage(106, LogLevel.Debug, "Opening circuit with id '{CircuitId}'.", EventName = "OnCircuitOpened")]
894[LoggerMessage(107, LogLevel.Debug, "Circuit id '{CircuitId}' connected using connection '{ConnectionId}'.", EventName = "OnConnectionUp")]
897[LoggerMessage(108, LogLevel.Debug, "Circuit id '{CircuitId}' disconnected from connection '{ConnectionId}'.", EventName = "OnConnectionDown")]
900[LoggerMessage(109, LogLevel.Debug, "Closing circuit with id '{CircuitId}'.", EventName = "OnCircuitClosed")]
903[LoggerMessage(110, LogLevel.Error, "Unhandled error invoking circuit handler type {handlerType}.{handlerMethod}: {Message}", EventName = "CircuitHandlerFailed")]
906[LoggerMessage(111, LogLevel.Debug, "Update root components started.", EventName = nameof(UpdateRootComponentsStarted))]
909[LoggerMessage(112, LogLevel.Debug, "Update root components succeeded.", EventName = nameof(UpdateRootComponentsSucceeded))]
912[LoggerMessage(113, LogLevel.Debug, "Update root components failed.", EventName = nameof(UpdateRootComponentsFailed))]
925[LoggerMessage(111, LogLevel.Error, "Unhandled exception in circuit '{CircuitId}'.", EventName = "CircuitUnhandledException")]
928[LoggerMessage(112, LogLevel.Debug, "About to notify client of an error in circuit '{CircuitId}'.", EventName = "CircuitTransmittingClientError")]
931[LoggerMessage(113, LogLevel.Debug, "Successfully transmitted error to client in circuit '{CircuitId}'.", EventName = "CircuitTransmittedClientErrorSuccess")]
934[LoggerMessage(114, LogLevel.Debug, "Failed to transmit exception to client in circuit '{CircuitId}'.", EventName = "CircuitTransmitErrorFailed")]
937[LoggerMessage(115, LogLevel.Debug, "An exception occurred on the circuit host '{CircuitId}' while the client is disconnected.", EventName = "UnhandledExceptionClientDisconnected")]
940[LoggerMessage(116, LogLevel.Debug, "The root component operation of type 'Update' was invalid: {Message}", EventName = nameof(InvalidComponentTypeForUpdate))]
943[LoggerMessage(200, LogLevel.Debug, "Failed to parse the event data when trying to dispatch an event.", EventName = "DispatchEventFailedToParseEventData")]
946[LoggerMessage(201, LogLevel.Debug, "There was an error dispatching the event '{EventHandlerId}' to the application.", EventName = "DispatchEventFailedToDispatchEvent")]
949[LoggerMessage(202, LogLevel.Debug, "Invoking instance method '{MethodIdentifier}' on instance '{DotNetObjectId}' with callback id '{CallId}'.", EventName = "BeginInvokeDotNet")]
952[LoggerMessage(203, LogLevel.Debug, "Failed to invoke instance method '{MethodIdentifier}' on instance '{DotNetObjectId}' with callback id '{CallId}'.", EventName = "BeginInvokeDotNetFailed")]
955[LoggerMessage(204, LogLevel.Debug, "There was an error invoking 'Microsoft.JSInterop.DotNetDispatcher.EndInvoke'.", EventName = "EndInvokeDispatchException")]
958[LoggerMessage(205, LogLevel.Debug, "The JS interop call with callback id '{AsyncCall}' with arguments {Arguments}.", EventName = "EndInvokeJSFailed")]
961[LoggerMessage(206, LogLevel.Debug, "The JS interop call with callback id '{AsyncCall}' succeeded.", EventName = "EndInvokeJSSucceeded")]
964[LoggerMessage(208, LogLevel.Debug, "Location changing to {URI} in circuit '{CircuitId}'.", EventName = "LocationChange")]
967[LoggerMessage(209, LogLevel.Debug, "Location change to '{URI}' in circuit '{CircuitId}' succeeded.", EventName = "LocationChangeSucceeded")]
970[LoggerMessage(210, LogLevel.Debug, "Location change to '{URI}' in circuit '{CircuitId}' failed.", EventName = "LocationChangeFailed")]
973[LoggerMessage(211, LogLevel.Debug, "Location is about to change to {URI} in ciruit '{CircuitId}'.", EventName = "LocationChanging")]
976[LoggerMessage(212, LogLevel.Debug, "Failed to complete render batch '{RenderId}' in circuit host '{CircuitId}'.", EventName = "OnRenderCompletedFailed")]
979[LoggerMessage(213, LogLevel.Debug, "The ReceiveByteArray call with id '{id}' succeeded.", EventName = "ReceiveByteArraySucceeded")]
982[LoggerMessage(214, LogLevel.Debug, "The ReceiveByteArray call with id '{id}' failed.", EventName = "ReceiveByteArrayException")]
985[LoggerMessage(215, LogLevel.Debug, "The ReceiveJSDataChunk call with stream id '{streamId}' failed.", EventName = "ReceiveJSDataChunkException")]
988[LoggerMessage(216, LogLevel.Debug, "The SendDotNetStreamAsync call with id '{id}' failed.", EventName = "SendDotNetStreamException")]
991[LoggerMessage(217, LogLevel.Debug, "Invoking static method with identifier '{MethodIdentifier}' on assembly '{Assembly}' with callback id '{CallId}'.", EventName = "BeginInvokeDotNetStatic")]
1006[LoggerMessage(218, LogLevel.Debug, "Failed to invoke static method with identifier '{MethodIdentifier}' on assembly '{Assembly}' with callback id '{CallId}'.", EventName = "BeginInvokeDotNetStaticFailed")]
1021[LoggerMessage(219, LogLevel.Error, "Location change to '{URI}' in circuit '{CircuitId}' failed.", EventName = "LocationChangeFailedInCircuit")]
Circuits\CircuitRegistry.cs (15)
366[LoggerMessage(100, LogLevel.Error, "Unhandled exception disposing circuit host: {Message}", EventName = "ExceptionDisposingCircuit")]
372[LoggerMessage(101, LogLevel.Debug, "Exception thrown when disposing token source: {Message}", EventName = "ExceptionDisposingTokenSource")]
378[LoggerMessage(102, LogLevel.Debug, "Attempting to reconnect to Circuit with secret {CircuitHost}.", EventName = "AttemptingToReconnect")]
381[LoggerMessage(104, LogLevel.Debug, "Failed to find a matching circuit for circuit secret {CircuitHost}.", EventName = "FailedToFindCircuit")]
384[LoggerMessage(105, LogLevel.Debug, "Transferring active circuit {CircuitId} to connection {ConnectionId}.", EventName = "ConnectingToActiveCircuit")]
387[LoggerMessage(106, LogLevel.Debug, "Transferring disconnected circuit {CircuitId} to connection {ConnectionId}.", EventName = "ConnectingToDisconnectedCircuit")]
390[LoggerMessage(107, LogLevel.Debug, "Failed to reconnect to a circuit with id {CircuitId}.", EventName = "FailedToReconnectToCircuit")]
393[LoggerMessage(108, LogLevel.Debug, "Attempting to disconnect circuit with id {CircuitId} from connection {ConnectionId}.", EventName = "CircuitDisconnectStarted")]
396[LoggerMessage(109, LogLevel.Debug, "Failed to disconnect circuit with id {CircuitId}. The circuit is not active.", EventName = "CircuitNotActive")]
399[LoggerMessage(110, LogLevel.Debug, "Failed to disconnect circuit with id {CircuitId}. The circuit is connected to {ConnectionId}.", EventName = "CircuitConnectedToDifferentConnection")]
402[LoggerMessage(111, LogLevel.Debug, "Circuit with id {CircuitId} is disconnected.", EventName = "CircuitMarkedDisconnected")]
405[LoggerMessage(112, LogLevel.Debug, "Circuit with id {CircuitId} evicted due to {EvictionReason}.", EventName = "CircuitEvicted")]
408[LoggerMessage(113, LogLevel.Debug, "Circuit with id {CircuitId} has been removed from the registry for permanent disconnection.", EventName = "CircuitDisconnectedPermanently")]
411[LoggerMessage(114, LogLevel.Error, "Exception handler for {CircuitId} failed.", EventName = "CircuitExceptionHandlerFailed")]
414[LoggerMessage(115, LogLevel.Debug, "Reconnect to circuit with id {CircuitId} succeeded.", EventName = "ReconnectionSucceeded")]
Circuits\ComponentParameterDeserializer.cs (8)
86[LoggerMessage(1, LogLevel.Debug, "Parameter values must be an array.", EventName = "ParameterValuesInvalidFormat")]
89[LoggerMessage(2, LogLevel.Debug, "The parameter definition for '{ParameterName}' is incomplete: Type='{TypeName}' Assembly='{Assembly}'.", EventName = "IncompleteParameterDefinition")]
92[LoggerMessage(3, LogLevel.Debug, "The parameter '{ParameterName} with type '{TypeName}' in assembly '{Assembly}' could not be found.", EventName = "InvalidParameterType")]
95[LoggerMessage(4, LogLevel.Debug, "Could not parse the parameter value for parameter '{Name}' of type '{TypeName}' and assembly '{Assembly}'.", EventName = "InvalidParameterValue")]
98[LoggerMessage(5, LogLevel.Debug, "Failed to parse the parameter definitions.", EventName = "FailedToParseParameterDefinitions")]
101[LoggerMessage(6, LogLevel.Debug, "Failed to parse the parameter values.", EventName = "FailedToParseParameterValues")]
104[LoggerMessage(7, LogLevel.Debug, "The number of parameter definitions '{DescriptorsLength}' does not match the number parameter values '{ValuesLength}'.", EventName = "MismatchedParameterAndDefinitions")]
107[LoggerMessage(8, LogLevel.Debug, "The name is missing in a parameter definition.", EventName = "MissingParameterDefinitionName")]
Circuits\RemoteJSRuntime.cs (5)
198[LoggerMessage(1, LogLevel.Debug, "Begin invoke JS interop '{AsyncHandle}': '{FunctionIdentifier}'", EventName = "BeginInvokeJS")]
201[LoggerMessage(2, LogLevel.Debug, "There was an error invoking the static method '[{AssemblyName}]::{MethodIdentifier}' with callback id '{CallbackId}'.", EventName = "InvokeStaticDotNetMethodException")]
204[LoggerMessage(4, LogLevel.Debug, "There was an error invoking the instance method '{MethodIdentifier}' on reference '{DotNetObjectReference}' with callback id '{CallbackId}'.", EventName = "InvokeInstanceDotNetMethodException")]
207[LoggerMessage(3, LogLevel.Debug, "Invocation of '[{AssemblyName}]::{MethodIdentifier}' with callback id '{CallbackId}' completed successfully.", EventName = "InvokeStaticDotNetMethodSuccess")]
210[LoggerMessage(5, LogLevel.Debug, "Invocation of '{MethodIdentifier}' on reference '{DotNetObjectReference}' with callback id '{CallbackId}' completed successfully.", EventName = "InvokeInstanceDotNetMethodSuccess")]
Circuits\RemoteNavigationManager.cs (7)
182[LoggerMessage(1, LogLevel.Debug, "Requesting navigation to URI {Uri} with forceLoad={ForceLoad}, replace={Replace}", EventName = "RequestingNavigation")]
188[LoggerMessage(2, LogLevel.Debug, "Received notification that the URI has changed to {Uri} with isIntercepted={IsIntercepted}", EventName = "ReceivedLocationChangedNotification")]
191[LoggerMessage(3, LogLevel.Debug, "Navigation canceled when changing the location to {Uri}", EventName = "NavigationCanceled")]
194[LoggerMessage(4, LogLevel.Error, "Navigation failed when changing the location to {Uri}", EventName = "NavigationFailed")]
197[LoggerMessage(5, LogLevel.Error, "Failed to refresh", EventName = "RefreshFailed")]
200[LoggerMessage(6, LogLevel.Debug, "Navigation completed when changing the location to {Uri}", EventName = "NavigationCompleted")]
203[LoggerMessage(7, LogLevel.Debug, "Navigation stopped because the session ended when navigating to {Uri}", EventName = "NavigationStoppedSessionEnded")]
Circuits\RemoteRenderer.cs (8)
374[LoggerMessage(100, LogLevel.Warning, "Unhandled exception rendering component: {Message}", EventName = "ExceptionRenderingComponent")]
380[LoggerMessage(101, LogLevel.Debug, "Sending render batch {BatchId} of size {DataLength} bytes to client {ConnectionId}.", EventName = "BeginUpdateDisplayAsync")]
383[LoggerMessage(102, LogLevel.Debug, "Buffering remote render because the client on connection {ConnectionId} is disconnected.", EventName = "SkipUpdateDisplayAsync")]
386[LoggerMessage(103, LogLevel.Information, "Sending data for batch failed: {Message}", EventName = "SendBatchDataFailed")]
392[LoggerMessage(104, LogLevel.Debug, "Completing batch {BatchId} with error: {ErrorMessage} in {ElapsedMilliseconds}ms.", EventName = "CompletingBatchWithError")]
398[LoggerMessage(105, LogLevel.Debug, "Completing batch {BatchId} without error in {ElapsedMilliseconds}ms.", EventName = "CompletingBatchWithoutError")]
404[LoggerMessage(106, LogLevel.Debug, "Received a duplicate ACK for batch id '{IncomingBatchId}'.", EventName = "ReceivedDuplicateBatchAcknowledgement")]
407[LoggerMessage(107, LogLevel.Debug, "The queue of unacknowledged render batches is full.", EventName = "FullUnacknowledgedRenderBatchesQueue")]
Circuits\ServerComponentDeserializer.cs (13)
360[LoggerMessage(1, LogLevel.Debug, "Failed to deserialize the component descriptor.", EventName = "FailedToDeserializeDescriptor")]
363[LoggerMessage(2, LogLevel.Debug, "Failed to find component '{ComponentName}' in assembly '{Assembly}'.", EventName = "FailedToFindComponent")]
366[LoggerMessage(3, LogLevel.Debug, "Failed to unprotect the component descriptor.", EventName = "FailedToUnprotectDescriptor")]
369[LoggerMessage(4, LogLevel.Debug, "Invalid component marker type '{MarkerType}'.", EventName = "InvalidMarkerType")]
372[LoggerMessage(5, LogLevel.Debug, "The component marker is missing the descriptor.", EventName = "MissingMarkerDescriptor")]
375[LoggerMessage(6, LogLevel.Debug, "The descriptor invocationId is '{invocationId}' and got a descriptor with invocationId '{currentInvocationId}'.", EventName = "MismatchedInvocationId")]
378[LoggerMessage(7, LogLevel.Debug, "The last descriptor sequence was '{lastSequence}' and got a descriptor with sequence '{sequence}'.", EventName = "OutOfSequenceDescriptor")]
381[LoggerMessage(8, LogLevel.Debug, "The descriptor sequence '{sequence}' is an invalid start sequence.", EventName = "DescriptorSequenceMustStartAtZero")]
384[LoggerMessage(9, LogLevel.Debug, "The descriptor invocationId '{invocationId}' has expired.", EventName = "ExpiredInvocationId")]
387[LoggerMessage(10, LogLevel.Debug, "The descriptor with sequence '{sequence}' was already used for the current invocationId '{invocationId}'.", EventName = "ReusedDescriptorSequence")]
390[LoggerMessage(11, LogLevel.Debug, "The root component operation of type '{OperationType}' was invalid: {Message}", EventName = "InvalidRootComponentOperation")]
393[LoggerMessage(12, LogLevel.Debug, "Failed to parse root component operations", EventName = nameof(FailedToProcessRootComponentOperations))]
396[LoggerMessage(13, LogLevel.Debug, "The provided root component key was not valid.", EventName = nameof(InvalidRootComponentKey))]
ComponentHub.cs (10)
374[LoggerMessage(1, LogLevel.Debug, "Received confirmation for batch {BatchId}", EventName = "ReceivedConfirmationForBatch")]
377[LoggerMessage(2, LogLevel.Debug, "The circuit host '{CircuitId}' has already been initialized", EventName = "CircuitAlreadyInitialized")]
380[LoggerMessage(3, LogLevel.Debug, "Call to '{CallSite}' received before the circuit host initialization", EventName = "CircuitHostNotInitialized")]
383[LoggerMessage(4, LogLevel.Debug, "Call to '{CallSite}' received after the circuit was shut down", EventName = "CircuitHostShutdown")]
386[LoggerMessage(5, LogLevel.Debug, "Call to '{CallSite}' received invalid input data", EventName = "InvalidInputData")]
389[LoggerMessage(6, LogLevel.Debug, "Circuit initialization failed", EventName = "CircuitInitializationFailed")]
392[LoggerMessage(7, LogLevel.Debug, "Created circuit '{CircuitId}' with secret '{CircuitIdSecret}' for '{ConnectionId}'", EventName = "CreatedCircuit")]
398if (!logger.IsEnabled(LogLevel.Trace))
406[LoggerMessage(8, LogLevel.Debug, "ConnectAsync received an invalid circuit id '{CircuitIdSecret}'", EventName = "InvalidCircuitId")]
412if (!logger.IsEnabled(LogLevel.Trace))
Microsoft.AspNetCore.Components.Tests (2)
Microsoft.AspNetCore.Components.WebAssembly (23)
Services\WebAssemblyConsoleLogger.cs (20)
16private static readonly string _messagePadding = new(' ', GetLogLevelString(LogLevel.Information).Length + _loglevelPadding.Length);
39public bool IsEnabled(LogLevel logLevel)
41return logLevel != LogLevel.None;
44public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
61private void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception? exception)
72case LogLevel.Trace:
73case LogLevel.Debug:
82case LogLevel.Information:
85case LogLevel.Warning:
88case LogLevel.Error:
91case LogLevel.Critical:
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
107private static void CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception? exception)
138private static string GetLogLevelString(LogLevel logLevel)
142case LogLevel.Trace:
144case LogLevel.Debug:
146case LogLevel.Information:
148case LogLevel.Warning:
150case LogLevel.Error:
152case LogLevel.Critical:
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.Components.WebView.Maui (19)
src\BlazorWebView\src\SharedSource\Log.cs (19)
8 [LoggerMessage(EventId = 0, Level = LogLevel.Debug, Message = "Navigating to {uri}.")]
11 [LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "Failed to create WebView2 environment. This could mean that WebView2 is not installed.")]
14 [LoggerMessage(EventId = 2, Level = LogLevel.Debug, Message = "Starting WebView2...")]
17 [LoggerMessage(EventId = 3, Level = LogLevel.Debug, Message = "WebView2 is started.")]
20 [LoggerMessage(EventId = 4, Level = LogLevel.Debug, Message = "Handling web request to URI '{requestUri}'.")]
23 [LoggerMessage(EventId = 5, Level = LogLevel.Debug, Message = "Response content being sent for web request to URI '{requestUri}' with HTTP status code {statusCode}.")]
26 [LoggerMessage(EventId = 6, Level = LogLevel.Debug, Message = "Response content was not found for web request to URI '{requestUri}'.")]
29 [LoggerMessage(EventId = 7, Level = LogLevel.Debug, Message = "Navigation event for URI '{uri}' with URL loading strategy '{urlLoadingStrategy}'.")]
32 [LoggerMessage(EventId = 8, Level = LogLevel.Debug, Message = "Launching external browser for URI '{uri}'.")]
35 [LoggerMessage(EventId = 9, Level = LogLevel.Debug, Message = "Calling Blazor.start() in the WebView2.")]
38 [LoggerMessage(EventId = 10, Level = LogLevel.Debug, Message = "Creating file provider at content root '{contentRootDir}', using host page relative path '{hostPageRelativePath}'.")]
41 [LoggerMessage(EventId = 11, Level = LogLevel.Debug, Message = "Adding root component '{componentTypeName}' with selector '{componentSelector}'. Number of parameters: {parameterCount}")]
44 [LoggerMessage(EventId = 12, Level = LogLevel.Debug, Message = "Starting initial navigation to '{startPath}'.")]
47 [LoggerMessage(EventId = 13, Level = LogLevel.Debug, Message = "Creating Android.Webkit.WebView...")]
50 [LoggerMessage(EventId = 14, Level = LogLevel.Debug, Message = "Created Android.Webkit.WebView.")]
53 [LoggerMessage(EventId = 15, Level = LogLevel.Debug, Message = "Running Blazor startup scripts.")]
56 [LoggerMessage(EventId = 16, Level = LogLevel.Debug, Message = "Blazor startup scripts finished.")]
59 [LoggerMessage(EventId = 17, Level = LogLevel.Debug, Message = "Creating WebKit WKWebView...")]
62 [LoggerMessage(EventId = 18, Level = LogLevel.Debug, Message = "Created WebKit WKWebView.")]
Microsoft.AspNetCore.Components.WebView.WindowsForms (19)
Microsoft.AspNetCore.Components.WebView.Wpf (19)
src\BlazorWebView\src\SharedSource\Log.cs (19)
8 [LoggerMessage(EventId = 0, Level = LogLevel.Debug, Message = "Navigating to {uri}.")]
11 [LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "Failed to create WebView2 environment. This could mean that WebView2 is not installed.")]
14 [LoggerMessage(EventId = 2, Level = LogLevel.Debug, Message = "Starting WebView2...")]
17 [LoggerMessage(EventId = 3, Level = LogLevel.Debug, Message = "WebView2 is started.")]
20 [LoggerMessage(EventId = 4, Level = LogLevel.Debug, Message = "Handling web request to URI '{requestUri}'.")]
23 [LoggerMessage(EventId = 5, Level = LogLevel.Debug, Message = "Response content being sent for web request to URI '{requestUri}' with HTTP status code {statusCode}.")]
26 [LoggerMessage(EventId = 6, Level = LogLevel.Debug, Message = "Response content was not found for web request to URI '{requestUri}'.")]
29 [LoggerMessage(EventId = 7, Level = LogLevel.Debug, Message = "Navigation event for URI '{uri}' with URL loading strategy '{urlLoadingStrategy}'.")]
32 [LoggerMessage(EventId = 8, Level = LogLevel.Debug, Message = "Launching external browser for URI '{uri}'.")]
35 [LoggerMessage(EventId = 9, Level = LogLevel.Debug, Message = "Calling Blazor.start() in the WebView2.")]
38 [LoggerMessage(EventId = 10, Level = LogLevel.Debug, Message = "Creating file provider at content root '{contentRootDir}', using host page relative path '{hostPageRelativePath}'.")]
41 [LoggerMessage(EventId = 11, Level = LogLevel.Debug, Message = "Adding root component '{componentTypeName}' with selector '{componentSelector}'. Number of parameters: {parameterCount}")]
44 [LoggerMessage(EventId = 12, Level = LogLevel.Debug, Message = "Starting initial navigation to '{startPath}'.")]
47 [LoggerMessage(EventId = 13, Level = LogLevel.Debug, Message = "Creating Android.Webkit.WebView...")]
50 [LoggerMessage(EventId = 14, Level = LogLevel.Debug, Message = "Created Android.Webkit.WebView.")]
53 [LoggerMessage(EventId = 15, Level = LogLevel.Debug, Message = "Running Blazor startup scripts.")]
56 [LoggerMessage(EventId = 16, Level = LogLevel.Debug, Message = "Blazor startup scripts finished.")]
59 [LoggerMessage(EventId = 17, Level = LogLevel.Debug, Message = "Creating WebKit WKWebView...")]
62 [LoggerMessage(EventId = 18, Level = LogLevel.Debug, Message = "Created WebKit WKWebView.")]
Microsoft.AspNetCore.ConcurrencyLimiter (4)
ConcurrencyLimiterMiddleware.cs (4)
88[LoggerMessage(1, LogLevel.Debug, "MaxConcurrentRequests limit reached, request has been queued. Current active requests: {ActiveRequests}.", EventName = "RequestEnqueued")]
91[LoggerMessage(2, LogLevel.Debug, "Request dequeued. Current active requests: {ActiveRequests}.", EventName = "RequestDequeued")]
94[LoggerMessage(3, LogLevel.Debug, "Below MaxConcurrentRequests limit, running request immediately. Current active requests: {ActiveRequests}", EventName = "RequestRunImmediately")]
97[LoggerMessage(4, LogLevel.Debug, "Currently at the 'RequestQueueLimit', rejecting this request with a '503 server not available' error", EventName = "RequestRejectedQueueFull")]
Microsoft.AspNetCore.CookiePolicy (9)
LoggingExtensions.cs (9)
8[LoggerMessage(1, LogLevel.Trace, "Needs consent: {needsConsent}.", EventName = "NeedsConsent")]
11[LoggerMessage(2, LogLevel.Trace, "Has consent: {hasConsent}.", EventName = "HasConsent")]
14[LoggerMessage(3, LogLevel.Debug, "Consent granted.", EventName = "ConsentGranted")]
17[LoggerMessage(4, LogLevel.Debug, "Consent withdrawn.", EventName = "ConsentWithdrawn")]
20[LoggerMessage(5, LogLevel.Debug, "Cookie '{key}' suppressed due to consent policy.", EventName = "CookieSuppressed")]
23[LoggerMessage(6, LogLevel.Debug, "Delete cookie '{key}' suppressed due to developer policy.", EventName = "DeleteCookieSuppressed")]
26[LoggerMessage(7, LogLevel.Debug, "Cookie '{key}' upgraded to 'secure'.", EventName = "UpgradedToSecure")]
29[LoggerMessage(8, LogLevel.Debug, "Cookie '{key}' same site mode upgraded to '{mode}'.", EventName = "UpgradedSameSite")]
32[LoggerMessage(9, LogLevel.Debug, "Cookie '{key}' upgraded to 'httponly'.", EventName = "UpgradedToHttpOnly")]
Microsoft.AspNetCore.Cors (11)
CORSLoggerExtensions.cs (11)
10[LoggerMessage(1, LogLevel.Debug, "The request is a preflight request.", EventName = "IsPreflightRequest")]
13[LoggerMessage(2, LogLevel.Debug, "The request has an origin header: '{origin}'.", EventName = "RequestHasOriginHeader")]
16[LoggerMessage(3, LogLevel.Debug, "The request does not have an origin header.", EventName = "RequestDoesNotHaveOriginHeader")]
19[LoggerMessage(4, LogLevel.Information, "CORS policy execution successful.", EventName = "PolicySuccess")]
22[LoggerMessage(5, LogLevel.Information, "CORS policy execution failed.", EventName = "PolicyFailure")]
25[LoggerMessage(6, LogLevel.Information, "Request origin {origin} does not have permission to access the resource.", EventName = "OriginNotAllowed")]
28[LoggerMessage(7, LogLevel.Information, "Request method {accessControlRequestMethod} not allowed in CORS policy.", EventName = "AccessControlMethodNotAllowed")]
31[LoggerMessage(8, LogLevel.Information, "Request header '{requestHeader}' not allowed in CORS policy.", EventName = "RequestHeaderNotAllowed")]
34[LoggerMessage(9, LogLevel.Warning, "Failed to apply CORS Response headers.", EventName = "FailedToSetCorsHeaders")]
37[LoggerMessage(10, LogLevel.Information, "No CORS policy found for the specified request.", EventName = "NoCorsPolicyFound")]
40[LoggerMessage(12, LogLevel.Debug, "This request uses the HTTP OPTIONS method but does not have an Access-Control-Request-Method header. This request will not be treated as a CORS preflight request.", EventName = "IsNotPreflightRequest")]
Microsoft.AspNetCore.DataProtection (83)
LoggingExtensions.cs (82)
24return IsLogLevelEnabledCore(logger, LogLevel.Debug);
34return IsLogLevelEnabledCore(logger, LogLevel.Trace);
38private static bool IsLogLevelEnabledCore([NotNullWhen(true)] ILogger? logger, LogLevel level)
43[LoggerMessage(1, LogLevel.Warning, "Policy resolution states that a new key should be added to the key ring, but automatic generation of keys is disabled. Using fallback key {KeyId:B} with expiration {ExpirationDate:u} as default key.", EventName = "UsingFallbackKeyWithExpirationAsDefaultKey")]
46[LoggerMessage(2, LogLevel.Debug, "Using key {KeyId:B} as the default key.", EventName = "UsingKeyAsDefaultKey")]
49[LoggerMessage(3, LogLevel.Debug, "Opening CNG algorithm '{HashAlgorithm}' from provider '{HashAlgorithmProvider}' with HMAC.", EventName = "OpeningCNGAlgorithmFromProviderWithHMAC")]
52[LoggerMessage(4, LogLevel.Debug, "Opening CNG algorithm '{EncryptionAlgorithm}' from provider '{EncryptionAlgorithmProvider}' with chaining mode CBC.", EventName = "OpeningCNGAlgorithmFromProviderWithChainingModeCBC")]
55[LoggerMessage(5, LogLevel.Trace, "Performing unprotect operation to key {KeyId:B} with purposes {Purposes}.", EventName = "PerformingUnprotectOperationToKeyWithPurposes")]
58[LoggerMessage(6, LogLevel.Trace, "Key {KeyId:B} was not found in the key ring. Unprotect operation cannot proceed.", EventName = "KeyWasNotFoundInTheKeyRingUnprotectOperationCannotProceed")]
61[LoggerMessage(7, LogLevel.Debug, "Key {KeyId:B} was revoked. Caller requested unprotect operation proceed regardless.", EventName = "KeyWasRevokedCallerRequestedUnprotectOperationProceedRegardless")]
64[LoggerMessage(8, LogLevel.Debug, "Key {KeyId:B} was revoked. Unprotect operation cannot proceed.", EventName = "KeyWasRevokedUnprotectOperationCannotProceed")]
67[LoggerMessage(9, LogLevel.Debug, "Opening CNG algorithm '{EncryptionAlgorithm}' from provider '{EncryptionAlgorithmProvider}' with chaining mode GCM.", EventName = "OpeningCNGAlgorithmFromProviderWithChainingModeGCM")]
70[LoggerMessage(10, LogLevel.Debug, "Using managed keyed hash algorithm '{FullName}'.", EventName = "UsingManagedKeyedHashAlgorithm")]
73[LoggerMessage(11, LogLevel.Debug, "Using managed symmetric algorithm '{FullName}'.", EventName = "UsingManagedSymmetricAlgorithm")]
76[LoggerMessage(12, LogLevel.Warning, "Key {KeyId:B} is ineligible to be the default key because its {MethodName} method failed after the maximum number of retries.", EventName = "KeyIsIneligibleToBeTheDefaultKeyBecauseItsMethodFailed")]
79[LoggerMessage(13, LogLevel.Debug, "Considering key {KeyId:B} with expiration date {ExpirationDate:u} as default key.", EventName = "ConsideringKeyWithExpirationDateAsDefaultKey")]
82[LoggerMessage(14, LogLevel.Debug, "Key {KeyId:B} is no longer under consideration as default key because it is expired, revoked, or cannot be deciphered.", EventName = "KeyIsNoLongerUnderConsiderationAsDefault")]
85[LoggerMessage(15, LogLevel.Warning, "Unknown element with name '{Name}' found in keyring, skipping.", EventName = "UnknownElementWithNameFoundInKeyringSkipping")]
88[LoggerMessage(16, LogLevel.Debug, "Marked key {KeyId:B} as revoked in the keyring.", EventName = "MarkedKeyAsRevokedInTheKeyring")]
91[LoggerMessage(17, LogLevel.Warning, "Tried to process revocation of key {KeyId:B}, but no such key was found in keyring. Skipping.", EventName = "TriedToProcessRevocationOfKeyButNoSuchKeyWasFound")]
94[LoggerMessage(18, LogLevel.Debug, "Found key {KeyId:B}.", EventName = "FoundKey")]
97[LoggerMessage(19, LogLevel.Debug, "Found revocation of all keys created prior to {RevocationDate:u}.", EventName = "FoundRevocationOfAllKeysCreatedPriorTo")]
100[LoggerMessage(20, LogLevel.Debug, "Found revocation of key {KeyId:B}.", EventName = "FoundRevocationOfKey")]
103[LoggerMessage(21, LogLevel.Error, "An exception occurred while processing the revocation element '{RevocationElement}'. Cannot continue keyring processing.", EventName = "ExceptionWhileProcessingRevocationElement")]
106[LoggerMessage(22, LogLevel.Information, "Revoking all keys as of {RevocationDate:u} for reason '{Reason}'.", EventName = "RevokingAllKeysAsOfForReason")]
109[LoggerMessage(23, LogLevel.Debug, "Key cache expiration token triggered by '{OperationName}' operation.", EventName = "KeyCacheExpirationTokenTriggeredByOperation")]
112[LoggerMessage(24, LogLevel.Error, "An exception occurred while processing the key element '{Element}'.", EventName = "ExceptionOccurredWhileProcessingTheKeyElement")]
115[LoggerMessage(25, LogLevel.Trace, "An exception occurred while processing the key element '{Element}'.", EventName = "ExceptionOccurredWhileProcessingTheKeyElementDebug")]
118[LoggerMessage(26, LogLevel.Debug, "Encrypting to Windows DPAPI for current user account ({Name}).", EventName = "EncryptingToWindowsDPAPIForCurrentUserAccount")]
121[LoggerMessage(28, LogLevel.Error, "An error occurred while encrypting to X.509 certificate with thumbprint '{Thumbprint}'.", EventName = "ErrorOccurredWhileEncryptingToX509CertificateWithThumbprint")]
124[LoggerMessage(29, LogLevel.Debug, "Encrypting to X.509 certificate with thumbprint '{Thumbprint}'.", EventName = "EncryptingToX509CertificateWithThumbprint")]
127[LoggerMessage(30, LogLevel.Error, "An exception occurred while trying to resolve certificate with thumbprint '{Thumbprint}'.", EventName = "ExceptionOccurredWhileTryingToResolveCertificateWithThumbprint")]
130[LoggerMessage(31, LogLevel.Trace, "Performing protect operation to key {KeyId:B} with purposes {Purposes}.", EventName = "PerformingProtectOperationToKeyWithPurposes")]
133[LoggerMessage(32, LogLevel.Debug, "Descriptor deserializer type for key {KeyId:B} is '{AssemblyQualifiedName}'.", EventName = "DescriptorDeserializerTypeForKeyIs")]
136[LoggerMessage(33, LogLevel.Debug, "Key escrow sink found. Writing key {KeyId:B} to escrow.", EventName = "KeyEscrowSinkFoundWritingKeyToEscrow")]
139[LoggerMessage(34, LogLevel.Debug, "No key escrow sink found. Not writing key {KeyId:B} to escrow.", EventName = "NoKeyEscrowSinkFoundNotWritingKeyToEscrow")]
142[LoggerMessage(35, LogLevel.Warning, "No XML encryptor configured. Key {KeyId:B} may be persisted to storage in unencrypted form.", EventName = "NoXMLEncryptorConfiguredKeyMayBePersistedToStorageInUnencryptedForm")]
145[LoggerMessage(36, LogLevel.Information, "Revoking key {KeyId:B} at {RevocationDate:u} for reason '{Reason}'.", EventName = "RevokingKeyForReason")]
148[LoggerMessage(37, LogLevel.Debug, "Reading data from file '{FullPath}'.", EventName = "ReadingDataFromFile")]
151[LoggerMessage(38, LogLevel.Debug, "The name '{FriendlyName}' is not a safe file name, using '{NewFriendlyName}' instead.", EventName = "NameIsNotSafeFileName")]
154[LoggerMessage(39, LogLevel.Information, "Writing data to file '{FileName}'.", EventName = "WritingDataToFile")]
157[LoggerMessage(40, LogLevel.Debug, "Reading data from registry key '{RegistryKeyName}', value '{Value}'.", EventName = "ReadingDataFromRegistryKeyValue")]
160[LoggerMessage(41, LogLevel.Debug, "The name '{FriendlyName}' is not a safe registry value name, using '{NewFriendlyName}' instead.", EventName = "NameIsNotSafeRegistryValueName")]
163[LoggerMessage(42, LogLevel.Debug, "Decrypting secret element using Windows DPAPI-NG with protection descriptor rule '{DescriptorRule}'.", EventName = "DecryptingSecretElementUsingWindowsDPAPING")]
166[LoggerMessage(27, LogLevel.Debug, "Encrypting to Windows DPAPI-NG using protection descriptor rule '{DescriptorRule}'.", EventName = "EncryptingToWindowsDPAPINGUsingProtectionDescriptorRule")]
169[LoggerMessage(43, LogLevel.Error, "An exception occurred while trying to decrypt the element.", EventName = "ExceptionOccurredTryingToDecryptElement")]
172[LoggerMessage(44, LogLevel.Warning, "Encrypting using a null encryptor; secret information isn't being protected.", EventName = "EncryptingUsingNullEncryptor")]
175[LoggerMessage(45, LogLevel.Information, "Using ephemeral data protection provider. Payloads will be undecipherable upon application shutdown.", EventName = "UsingEphemeralDataProtectionProvider")]
178[LoggerMessage(46, LogLevel.Debug, "Existing cached key ring is expired. Refreshing.", EventName = "ExistingCachedKeyRingIsExpiredRefreshing")]
181[LoggerMessage(47, LogLevel.Error, "An error occurred while refreshing the key ring. Will try again in 2 minutes.", EventName = "ErrorOccurredWhileRefreshingKeyRing")]
184[LoggerMessage(48, LogLevel.Error, "An error occurred while reading the key ring.", EventName = "ErrorOccurredWhileReadingKeyRing")]
187[LoggerMessage(49, LogLevel.Error, "The key ring does not contain a valid default protection key. The data protection system cannot create a new key because auto-generation of keys is disabled. For more information go to http://aka.ms/dataprotectionwarning", EventName = "KeyRingDoesNotContainValidDefaultKey")]
190[LoggerMessage(50, LogLevel.Warning, "Using an in-memory repository. Keys will not be persisted to storage.", EventName = "UsingInMemoryRepository")]
193[LoggerMessage(51, LogLevel.Debug, "Decrypting secret element using Windows DPAPI.", EventName = "DecryptingSecretElementUsingWindowsDPAPI")]
196[LoggerMessage(52, LogLevel.Debug, "Default key expiration imminent and repository contains no viable successor. Caller should generate a successor.", EventName = "DefaultKeyExpirationImminentAndRepository")]
199[LoggerMessage(53, LogLevel.Debug, "Repository contains no viable default key. Caller should generate a key with immediate activation.", EventName = "RepositoryContainsNoViableDefaultKey")]
202[LoggerMessage(54, LogLevel.Error, "An error occurred while encrypting to Windows DPAPI.", EventName = "ErrorOccurredWhileEncryptingToWindowsDPAPI")]
205[LoggerMessage(55, LogLevel.Debug, "Encrypting to Windows DPAPI for local machine account.", EventName = "EncryptingToWindowsDPAPIForLocalMachineAccount")]
208[LoggerMessage(56, LogLevel.Error, "An error occurred while encrypting to Windows DPAPI-NG.", EventName = "ErrorOccurredWhileEncryptingToWindowsDPAPING")]
211[LoggerMessage(57, LogLevel.Debug, "Policy resolution states that a new key should be added to the key ring.", EventName = "PolicyResolutionStatesThatANewKeyShouldBeAddedToTheKeyRing")]
214[LoggerMessage(58, LogLevel.Information, "Creating key {KeyId:B} with creation date {CreationDate:u}, activation date {ActivationDate:u}, and expiration date {ExpirationDate:u}.", EventName = "CreatingKey")]
217[LoggerMessage(59, LogLevel.Warning, "Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.", EventName = "UsingEphemeralKeyRepository")]
220[LoggerMessage(61, LogLevel.Information, "User profile not available. Using '{Name}' as key repository and Windows DPAPI to encrypt keys at rest.", EventName = "UsingRegistryAsKeyRepositoryWithDPAPI")]
223[LoggerMessage(62, LogLevel.Information, "User profile is available. Using '{FullName}' as key repository; keys will not be encrypted at rest.", EventName = "UsingProfileAsKeyRepository")]
226[LoggerMessage(63, LogLevel.Information, "User profile is available. Using '{FullName}' as key repository and Windows DPAPI to encrypt keys at rest.", EventName = "UsingProfileAsKeyRepositoryWithDPAPI")]
229[LoggerMessage(64, LogLevel.Information, "Azure Web Sites environment detected. Using '{FullName}' as key repository; keys will not be encrypted at rest.", EventName = "UsingAzureAsKeyRepository")]
232[LoggerMessage(65, LogLevel.Debug, "Key ring with default key {KeyId:B} was loaded during application startup.", EventName = "KeyRingWasLoadedOnStartup")]
235[LoggerMessage(66, LogLevel.Information, "Key ring failed to load during application startup.", EventName = "KeyRingFailedToLoadOnStartup")]
238[LoggerMessage(60, LogLevel.Warning, "Storing keys in a directory '{path}' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning", EventName = "UsingEphemeralFileSystemLocationInContainer")]
241[LoggerMessage(61, LogLevel.Trace, "Ignoring configuration '{PropertyName}' for options instance '{OptionsName}'", EventName = "IgnoringReadOnlyConfigurationForNonDefaultOptions")]
244[LoggerMessage(62, LogLevel.Information, "Enabling read-only key access with repository directory '{Path}'", EventName = "UsingReadOnlyKeyConfiguration")]
247[LoggerMessage(63, LogLevel.Debug, "Not enabling read-only key access because an XML repository has been specified", EventName = "NotUsingReadOnlyKeyConfigurationBecauseOfRepository")]
250[LoggerMessage(64, LogLevel.Debug, "Not enabling read-only key access because an XML encryptor has been specified", EventName = "NotUsingReadOnlyKeyConfigurationBecauseOfEncryptor")]
253[LoggerMessage(72, LogLevel.Error, "The key ring's default data protection key {KeyId:B} has been revoked.", EventName = "KeyRingDefaultKeyIsRevoked")]
256[LoggerMessage(73, LogLevel.Debug, "Key {KeyId:B} method {MethodName} failed. Retrying.", EventName = "RetryingMethodOfKeyAfterFailure")]
259[LoggerMessage(74, LogLevel.Debug, "Deleting file '{FileName}'.", EventName = "DeletingFile")]
262[LoggerMessage(75, LogLevel.Error, "Failed to delete file '{FileName}'. Not attempting further deletions.", EventName = "FailedToDeleteFile")]
265[LoggerMessage(76, LogLevel.Debug, "Deleting registry key '{RegistryKeyName}', value '{Value}'.", EventName = "RemovingDataFromRegistryKeyValue")]
268[LoggerMessage(77, LogLevel.Error, "Failed to delete registry key '{RegistryKeyName}', value '{ValueName}'. Not attempting further deletions.", EventName = "FailedToRemoveDataFromRegistryKeyValue")]
271[LoggerMessage(78, LogLevel.Trace, "Found multiple revocation entries for key {KeyId:B}.", EventName = "KeyRevokedMultipleTimes")]
274[LoggerMessage(79, LogLevel.Trace, "Ignoring revocation of keys created before {OlderDate:u} in favor of revocation of keys created before {NewerDate:u}.", EventName = "DateBasedRevocationSuperseded")]
277[LoggerMessage(80, LogLevel.Debug, "Deleting key {KeyId:B}.", EventName = "DeletingKey")]
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (2)
Microsoft.AspNetCore.DataProtection.Tests (7)
Microsoft.AspNetCore.Diagnostics (7)
DiagnosticsLoggerExtensions.cs (6)
11[LoggerMessage(1, LogLevel.Error, "An unhandled exception has occurred while executing the request.", EventName = "UnhandledException")]
14[LoggerMessage(4, LogLevel.Debug, "The request was aborted by the client.", EventName = "RequestAborted")]
18[LoggerMessage(2, LogLevel.Warning, "The response has already started, the error handler will not be executed.", EventName = "ResponseStarted")]
21[LoggerMessage(3, LogLevel.Error, "An exception was thrown attempting to execute the error handler.", EventName = "Exception")]
27[LoggerMessage(2, LogLevel.Warning, "The response has already started, the error page middleware will not be executed.", EventName = "ResponseStarted")]
30[LoggerMessage(3, LogLevel.Error, "An exception was thrown attempting to display the error page.", EventName = "DisplayErrorPageException")]
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (14)
DiagnosticsEntityFrameworkCoreLoggerExtensions.cs (14)
10[LoggerMessage(1, LogLevel.Error, "No context type was specified. Ensure the form data from the request includes a 'context' value, specifying the context type name to apply migrations for.", EventName = "NoContextType")]
13[LoggerMessage(3, LogLevel.Error, "The context type '{ContextTypeName}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped<>() inside the UseServices(...) call in your application startup code.", EventName = "ContextNotRegistered")]
16[LoggerMessage(4, LogLevel.Debug, "Request path matched the path configured for this migrations endpoint({RequestPath}). Attempting to process the migrations request.", EventName = "RequestPathMatched")]
19[LoggerMessage(5, LogLevel.Debug, "Request is valid, applying migrations for context '{ContextTypeName}'", EventName = "ApplyingMigrations")]
22[LoggerMessage(6, LogLevel.Debug, "Migrations successfully applied for context '{ContextTypeName}'.", EventName = "MigrationsApplied")]
25[LoggerMessage(7, LogLevel.Error, "An error occurred while applying the migrations for '{ContextTypeName}'. See InnerException for details:", EventName = "MigrationsEndPointException")]
31[LoggerMessage(1, LogLevel.Debug, "{ExceptionType} occurred, checking if Entity Framework recorded this exception as resulting from a failed database operation.", EventName = "AttemptingToMatchException")]
34[LoggerMessage(2, LogLevel.Debug, "Entity Framework did not record any exceptions due to failed database operations. This means the current exception is not a failed Entity Framework database operation, or the current exception occurred from a DbContext that was not obtained from request services.", EventName = "NoRecordedException")]
37[LoggerMessage(3, LogLevel.Debug, "The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request.", EventName = "NoMatchFound")]
40[LoggerMessage(4, LogLevel.Debug, "Entity Framework recorded that the current exception was due to a failed database operation. Attempting to show database error page.", EventName = "MatchFound")]
43[LoggerMessage(6, LogLevel.Debug, "The target data store is not a relational database. Skipping the database error page.", EventName = "NotRelationalDatabase")]
46[LoggerMessage(5, LogLevel.Error, "The context type '{ContextTypeName}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped<>() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.", EventName = "ContextNotRegistered")]
49[LoggerMessage(7, LogLevel.Error, "An exception occurred while calculating the database error page content. Skipping display of the database error page.", EventName = "DatabaseErrorPageException")]
55[LoggerMessage(1, LogLevel.Warning, "The response has already started, the next developer page exception filter will not be executed.", EventName = "ResponseStarted")]
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (44)
Logging\AcceptanceTests.cs (31)
99private static Task RunAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
103LogLevel level,
110.AddFilter("Microsoft.Hosting", LogLevel.Warning)
111.AddFilter("Microsoft.Extensions.Hosting", LogLevel.Warning)
112.AddFilter("Microsoft.AspNetCore", LogLevel.Warning)
161LogLevel.Information,
180Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
221LogLevel.Information,
240Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
274LogLevel.Information,
306Assert.All(logRecords, x => Assert.Equal(LogLevel.Information, x.Level));
345LogLevel.Information,
368Assert.Equal(LogLevel.Information, lastRecord.Level);
399LogLevel.Information,
414Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
437LogLevel.Information,
456Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
471LogLevel.Information,
487Assert.All(logRecords, x => Assert.Equal(LogLevel.Information, x.Level));
508LogLevel.Information,
525Assert.All(logRecords, x => Assert.Equal(LogLevel.Information, x.Level));
565LogLevel.Information,
573Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
596LogLevel.Information,
614Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
633LogLevel.Information,
648Assert.Equal(LogLevel.Information, logCollector.LatestRecord.Level);
665LogLevel.Error,
693LogLevel.Information,
721LogLevel.Information,
741LogLevel.Debug,
Logging\AcceptanceTests.Mvc.cs (11)
51private static Task RunControllerAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
60LogLevel.Information,
75Assert.Equal(LogLevel.Information, logRecord.Level);
95LogLevel.Information,
110Assert.Equal(LogLevel.Information, logRecord.Level);
134LogLevel.Information,
156Assert.Equal(LogLevel.Information, logRecord.Level);
185LogLevel.Information,
200Assert.Equal(LogLevel.Information, logRecord.Level);
223LogLevel.Information,
241Assert.Equal(LogLevel.Information, logRecord.Level);
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.FunctionalTests (10)
WebApplicationFunctionalTests.cs (8)
35logger.Log(LogLevel.Information, 0, "Message", null, (s, e) =>
42logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
78logger.Log(LogLevel.Information, 0, "Message", null, (s, e) =>
85logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
130Assert.False(logger.IsEnabled(LogLevel.Warning));
132logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
161logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
169Assert.True(logger.IsEnabled(LogLevel.Warning));
WebHostFunctionalTests.cs (2)
127logger.Log(LogLevel.Information, 0, "Message", null, (s, e) =>
134logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
Microsoft.AspNetCore.Grpc.JsonTranscoding (17)
Internal\Binding\JsonTranscodingProviderServiceBinder.cs (4)
123if (_logger.IsEnabled(LogLevel.Trace))
272[LoggerMessage(1, LogLevel.Warning, "Unable to find method descriptor for {MethodName} on {ServiceType}.", EventName = "MethodDescriptorNotFound")]
275[LoggerMessage(2, LogLevel.Warning, "Unable to bind {MethodName} on {ServiceName} to gRPC JSON transcoding. Client and bidirectional streaming methods are not supported.", EventName = "StreamingMethodNotSupported")]
278[LoggerMessage(3, LogLevel.Trace, "Found HttpRule mapping. Method {MethodName} on {ServiceName}. HttpRule payload: {HttpRulePayload}", EventName = "HttpRuleFound", SkipEnabledCheck = true)]
Internal\GrpcServerLog.cs (11)
11[LoggerMessage(1, LogLevel.Information, "Request content-type of '{ContentType}' is not supported.", EventName = "UnsupportedRequestContentType")]
14[LoggerMessage(2, LogLevel.Error, "Error when executing service method '{ServiceMethod}'.", EventName = "ErrorExecutingServiceMethod")]
17[LoggerMessage(3, LogLevel.Information, "Error status code '{StatusCode}' with detail '{Detail}' raised.", EventName = "RpcConnectionError")]
20[LoggerMessage(4, LogLevel.Debug, "Reading message.", EventName = "ReadingMessage")]
23[LoggerMessage(5, LogLevel.Trace, "Deserializing to '{MessageType}'.", EventName = "DeserializingMessage")]
26[LoggerMessage(6, LogLevel.Trace, "Received message.", EventName = "ReceivedMessage")]
29[LoggerMessage(7, LogLevel.Information, "Error reading message.", EventName = "ErrorReadingMessage")]
32[LoggerMessage(8, LogLevel.Debug, "Sending message.", EventName = "SendingMessage")]
35[LoggerMessage(9, LogLevel.Debug, "Message sent.", EventName = "MessageSent")]
38[LoggerMessage(10, LogLevel.Information, "Error sending message.", EventName = "ErrorSendingMessage")]
41[LoggerMessage(11, LogLevel.Trace, "Serialized '{MessageType}'.", EventName = "SerializedMessage")]
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
Microsoft.AspNetCore.HeaderParsing (3)
Microsoft.AspNetCore.HostFiltering (10)
LoggerExtensions.cs (8)
10[LoggerMessage(0, LogLevel.Debug, "Wildcard detected, all requests with hosts will be allowed.", EventName = "WildcardDetected")]
13[LoggerMessage(1, LogLevel.Debug, "Allowed hosts: {Hosts}", EventName = "AllowedHosts", SkipEnabledCheck = true)]
16[LoggerMessage(2, LogLevel.Trace, "All hosts are allowed.", EventName = "AllHostsAllowed")]
19[LoggerMessage(3, LogLevel.Information, "{Protocol} request rejected due to missing or empty host header.", EventName = "RequestRejectedMissingHost")]
22[LoggerMessage(4, LogLevel.Debug, "{Protocol} request allowed with missing or empty host header.", EventName = "RequestAllowedMissingHost")]
25[LoggerMessage(5, LogLevel.Trace, "The host '{Host}' matches an allowed host.", EventName = "AllowedHostMatched")]
28[LoggerMessage(6, LogLevel.Information, "The host '{Host}' does not match an allowed host.", EventName = "NoAllowedHostMatched")]
31[LoggerMessage(7, LogLevel.Debug, "Middleware configuration started with options: {Options}", EventName = "MiddlewareConfigurationStarted")]
Microsoft.AspNetCore.Hosting (17)
Internal\WebHost.cs (6)
155if (_logger.IsEnabled(LogLevel.Debug))
351[LoggerMessage(3, LogLevel.Debug, "Hosting starting", EventName = "Starting")]
354[LoggerMessage(4, LogLevel.Debug, "Hosting started", EventName = "Started")]
357[LoggerMessage(5, LogLevel.Debug, "Hosting shutdown", EventName = "Shutdown")]
360[LoggerMessage(12, LogLevel.Debug, "Server shutdown exception", EventName = "ServerShutdownException")]
363[LoggerMessage(13, LogLevel.Debug,
Microsoft.AspNetCore.Hosting.Tests (6)
HostingApplicationDiagnosticsTests.cs (4)
1126public bool IsEnabled(LogLevel logLevel) => _isEnabled;
1128public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
1149public bool IsEnabled(LogLevel logLevel) => _isEnabled;
1151public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.Hosting.TestSites (1)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Connections (57)
Internal\HttpConnectionContext.cs (9)
766[LoggerMessage(1, LogLevel.Trace, "Disposing connection {TransportConnectionId}.", EventName = "DisposingConnection")]
769[LoggerMessage(2, LogLevel.Trace, "Waiting for application to complete.", EventName = "WaitingForApplication")]
772[LoggerMessage(3, LogLevel.Trace, "Application complete.", EventName = "ApplicationComplete")]
775[LoggerMessage(4, LogLevel.Trace, "Waiting for {TransportType} transport to complete.", EventName = "WaitingForTransport")]
778[LoggerMessage(5, LogLevel.Trace, "{TransportType} transport complete.", EventName = "TransportComplete")]
781[LoggerMessage(6, LogLevel.Trace, "Shutting down both the application and the {TransportType} transport.", EventName = "ShuttingDownTransportAndApplication")]
784[LoggerMessage(7, LogLevel.Trace, "Waiting for both the application and {TransportType} transport to complete.", EventName = "WaitingForTransportAndApplication")]
787[LoggerMessage(8, LogLevel.Trace, "The application and {TransportType} transport are both complete.", EventName = "TransportAndApplicationComplete")]
790[LoggerMessage(9, LogLevel.Trace, "{Timeout}ms elapsed attempting to send a message to the transport. Closing connection {TransportConnectionId}.", EventName = "TransportSendTimeout")]
Internal\HttpConnectionDispatcher.Log.cs (18)
12[LoggerMessage(1, LogLevel.Debug, "Connection {TransportConnectionId} was disposed.", EventName = "ConnectionDisposed")]
15[LoggerMessage(2, LogLevel.Debug, "Connection {TransportConnectionId} is already active via {RequestId}.", EventName = "ConnectionAlreadyActive")]
18[LoggerMessage(3, LogLevel.Trace, "Previous poll canceled for {TransportConnectionId} on {RequestId}.", EventName = "PollCanceled")]
21[LoggerMessage(4, LogLevel.Debug, "Establishing new connection.", EventName = "EstablishedConnection")]
24[LoggerMessage(5, LogLevel.Debug, "Resuming existing connection.", EventName = "ResumingConnection")]
27[LoggerMessage(6, LogLevel.Trace, "Received {Count} bytes.", EventName = "ReceivedBytes")]
30[LoggerMessage(7, LogLevel.Debug, "{TransportType} transport not supported by this connection handler.", EventName = "TransportNotSupported")]
33[LoggerMessage(8, LogLevel.Debug, "Cannot change transports mid-connection; currently using {TransportType}, requesting {RequestedTransport}.", EventName = "CannotChangeTransport")]
36[LoggerMessage(9, LogLevel.Debug, "POST requests are not allowed for websocket connections.", EventName = "PostNotAllowedForWebSockets")]
39[LoggerMessage(10, LogLevel.Debug, "Sending negotiation response.", EventName = "NegotiationRequest")]
42[LoggerMessage(11, LogLevel.Trace, "Received DELETE request for unsupported transport: {TransportType}.", EventName = "ReceivedDeleteRequestForUnsupportedTransport")]
45[LoggerMessage(12, LogLevel.Trace, "Terminating Long Polling connection due to a DELETE request.", EventName = "TerminatingConection")]
48[LoggerMessage(13, LogLevel.Debug, "Connection {TransportConnectionId} was disposed while a write was in progress.", EventName = "ConnectionDisposedWhileWriteInProgress")]
51[LoggerMessage(14, LogLevel.Debug, "Connection {TransportConnectionId} failed to read the HTTP request body.", EventName = "FailedToReadHttpRequestBody")]
54[LoggerMessage(15, LogLevel.Debug, "The client requested version '{clientProtocolVersion}', but the server does not support this version.", EventName = "NegotiateProtocolVersionMismatch")]
57[LoggerMessage(16, LogLevel.Debug, "The client requested an invalid protocol version '{queryStringVersionValue}'", EventName = "InvalidNegotiateProtocolVersion")]
60[LoggerMessage(17, LogLevel.Warning, "The name of the user changed from '{PreviousUserName}' to '{CurrentUserName}'.", EventName = "UserNameChanged")]
68[LoggerMessage(18, LogLevel.Debug, "Exception from IStatefulReconnectFeature.NotifyOnReconnect callback.", EventName = "NotifyOnReconnectError")]
Internal\HttpConnectionManager.Log.cs (9)
12[LoggerMessage(1, LogLevel.Debug, "New connection {TransportConnectionId} created.", EventName = "CreatedNewConnection")]
15[LoggerMessage(2, LogLevel.Debug, "Removing connection {TransportConnectionId} from the list of connections.", EventName = "RemovedConnection")]
18[LoggerMessage(3, LogLevel.Error, "Failed disposing connection {TransportConnectionId}.", EventName = "FailedDispose")]
21[LoggerMessage(5, LogLevel.Trace, "Connection {TransportConnectionId} timed out.", EventName = "ConnectionTimedOut")]
24[LoggerMessage(4, LogLevel.Trace, "Connection {TransportConnectionId} was reset.", EventName = "ConnectionReset")]
27[LoggerMessage(7, LogLevel.Error, "Scanning connections failed.", EventName = "ScanningConnectionsFailed")]
32[LoggerMessage(9, LogLevel.Trace, "Starting connection heartbeat.", EventName = "HeartBeatStarted")]
35[LoggerMessage(10, LogLevel.Trace, "Ending connection heartbeat.", EventName = "HeartBeatEnded")]
38[LoggerMessage(11, LogLevel.Debug, "Connection {TransportConnectionId} closing because the authentication token has expired.", EventName = "AuthenticationExpired")]
Internal\Transports\LongPollingServerTransport.cs (5)
117[LoggerMessage(1, LogLevel.Debug, "Terminating Long Polling connection by sending 204 response.", EventName = "LongPolling204")]
120[LoggerMessage(2, LogLevel.Debug, "Poll request timed out. Sending 200 response to connection.", EventName = "PollTimedOut")]
123[LoggerMessage(3, LogLevel.Trace, "Writing a {Count} byte message to connection.", EventName = "LongPollingWritingMessage")]
126[LoggerMessage(4, LogLevel.Debug, "Client disconnected from Long Polling endpoint for connection.", EventName = "LongPollingDisconnected")]
129[LoggerMessage(5, LogLevel.Error, "Long Polling transport was terminated due to an error on connection.", EventName = "LongPollingTerminated")]
Internal\Transports\WebSocketsServerTransport.Log.cs (15)
13[LoggerMessage(1, LogLevel.Debug, "Socket opened using Sub-Protocol: '{SubProtocol}'.", EventName = "SocketOpened")]
16[LoggerMessage(2, LogLevel.Debug, "Socket closed.", EventName = "SocketClosed")]
19[LoggerMessage(3, LogLevel.Debug, "Client closed connection with status code '{Status}' ({Description}). Signaling end-of-input to application.", EventName = "ClientClosed")]
22[LoggerMessage(4, LogLevel.Debug, "Waiting for the application to finish sending data.", EventName = "WaitingForSend")]
25[LoggerMessage(5, LogLevel.Debug, "Application failed during sending. Sending InternalServerError close frame.", EventName = "FailedSending")]
28[LoggerMessage(6, LogLevel.Debug, "Application finished sending. Sending close frame.", EventName = "FinishedSending")]
31[LoggerMessage(7, LogLevel.Debug, "Waiting for the client to close the socket.", EventName = "WaitingForClose")]
34[LoggerMessage(8, LogLevel.Debug, "Timed out waiting for client to send the close frame, aborting the connection.", EventName = "CloseTimedOut")]
37[LoggerMessage(9, LogLevel.Trace, "Message received. Type: {MessageType}, size: {Size}, EndOfMessage: {EndOfMessage}.", EventName = "MessageReceived")]
40[LoggerMessage(10, LogLevel.Trace, "Passing message to application. Payload size: {Size}.", EventName = "MessageToApplication")]
43[LoggerMessage(11, LogLevel.Trace, "Sending payload: {Size} bytes.", EventName = "SendPayload")]
46[LoggerMessage(12, LogLevel.Debug, "Error writing frame.", EventName = "ErrorWritingFrame")]
49[LoggerMessage(14, LogLevel.Debug, "Socket connection closed prematurely.", EventName = "ClosedPrematurely")]
52[LoggerMessage(15, LogLevel.Debug, "Closing webSocket failed.", EventName = "ClosingWebSocketFailed")]
55[LoggerMessage(16, LogLevel.Debug, "Send loop errored.", EventName = "SendErrored")]
Microsoft.AspNetCore.Http.Connections.Client (81)
HttpConnection.Log.cs (25)
15[LoggerMessage(1, LogLevel.Debug, "Starting HttpConnection.", EventName = "Starting")]
18[LoggerMessage(2, LogLevel.Debug, "Skipping start, connection is already started.", EventName = "SkippingStart")]
21[LoggerMessage(3, LogLevel.Information, "HttpConnection Started.", EventName = "Started")]
24[LoggerMessage(4, LogLevel.Debug, "Disposing HttpConnection.", EventName = "DisposingHttpConnection")]
27[LoggerMessage(5, LogLevel.Debug, "Skipping dispose, connection is already disposed.", EventName = "SkippingDispose")]
30[LoggerMessage(6, LogLevel.Information, "HttpConnection Disposed.", EventName = "Disposed")]
35if (logger.IsEnabled(LogLevel.Debug))
41[LoggerMessage(7, LogLevel.Debug, "Starting transport '{Transport}' with Url: {Url}.", EventName = "StartingTransport", SkipEnabledCheck = true)]
44[LoggerMessage(8, LogLevel.Debug, "Establishing connection with server at '{Url}'.", EventName = "EstablishingConnection")]
47[LoggerMessage(9, LogLevel.Debug, "Established connection '{ConnectionId}' with the server.", EventName = "Established")]
50[LoggerMessage(10, LogLevel.Error, "Failed to start connection. Error getting negotiation response from '{Url}'.", EventName = "ErrorWithNegotiation")]
53[LoggerMessage(11, LogLevel.Error, "Failed to start connection. Error starting transport '{Transport}'.", EventName = "ErrorStartingTransport")]
56[LoggerMessage(12, LogLevel.Debug, "Skipping transport {TransportName} because it is not supported by this client.", EventName = "TransportNotSupported")]
61if (logger.IsEnabled(LogLevel.Debug))
67[LoggerMessage(13, LogLevel.Debug, "Skipping transport {TransportName} because it does not support the requested transfer format '{TransferFormat}'.",
74if (logger.IsEnabled(LogLevel.Debug))
80[LoggerMessage(14, LogLevel.Debug, "Skipping transport {TransportName} because it was disabled by the client.", EventName = "TransportDisabledByClient", SkipEnabledCheck = true)]
85if (logger.IsEnabled(LogLevel.Debug))
91[LoggerMessage(15, LogLevel.Debug, "Skipping transport {TransportName} because it failed to initialize.", EventName = "TransportFailed", SkipEnabledCheck = true)]
94[LoggerMessage(16, LogLevel.Debug, "Skipping WebSockets because they are not supported by the operating system.", EventName = "WebSocketsNotSupportedByOperatingSystem")]
97[LoggerMessage(17, LogLevel.Error, "The transport threw an exception while stopping.", EventName = "TransportThrewExceptionOnStop")]
100[LoggerMessage(18, LogLevel.Debug, "Transport '{Transport}' started.", EventName = "TransportStarted")]
103[LoggerMessage(19, LogLevel.Debug, "Skipping ServerSentEvents because they are not supported by the browser.", EventName = "ServerSentEventsNotSupportedByBrowser")]
106[LoggerMessage(20, LogLevel.Trace, "Cookies are not supported on this platform.", EventName = "CookiesNotSupported")]
109[LoggerMessage(21, LogLevel.Debug, "{StatusCode} received, getting a new access token and retrying request.", EventName = "RetryAccessToken")]
Internal\LongPollingTransport.Log.cs (15)
16[LoggerMessage(1, LogLevel.Information, "Starting transport. Transfer mode: {TransferFormat}.", EventName = "StartTransport")]
19[LoggerMessage(2, LogLevel.Debug, "Transport stopped.", EventName = "TransportStopped")]
22[LoggerMessage(3, LogLevel.Debug, "Starting receive loop.", EventName = "StartReceive")]
25[LoggerMessage(6, LogLevel.Information, "Transport is stopping.", EventName = "TransportStopping")]
28[LoggerMessage(5, LogLevel.Debug, "Receive loop canceled.", EventName = "ReceiveCanceled")]
31[LoggerMessage(4, LogLevel.Debug, "Receive loop stopped.", EventName = "ReceiveStopped")]
34[LoggerMessage(7, LogLevel.Debug, "The server is closing the connection.", EventName = "ClosingConnection")]
37[LoggerMessage(8, LogLevel.Debug, "Received messages from the server.", EventName = "ReceivedMessages")]
40[LoggerMessage(9, LogLevel.Error, "Error while polling '{PollUrl}'.", EventName = "ErrorPolling")]
46if (logger.IsEnabled(LogLevel.Trace))
53[LoggerMessage(10, LogLevel.Trace, "Poll response with status code {StatusCode} received from server. Content length: {ContentLength}.", EventName = "PollResponseReceived", SkipEnabledCheck = true)]
56[LoggerMessage(11, LogLevel.Debug, "Sending DELETE request to '{PollUrl}'.", EventName = "SendingDeleteRequest")]
59[LoggerMessage(12, LogLevel.Debug, "DELETE request to '{PollUrl}' accepted.", EventName = "DeleteRequestAccepted")]
62[LoggerMessage(13, LogLevel.Error, "Error sending DELETE request to '{PollUrl}'.", EventName = "ErrorSendingDeleteRequest")]
65[LoggerMessage(14, LogLevel.Debug, "A 404 response was returned from sending DELETE request to '{PollUrl}', likely because the transport was already closed on the server.", EventName = "ConnectionAlreadyClosedSendingDeleteRequest")]
Internal\SendUtils.cs (7)
116[LoggerMessage(100, LogLevel.Debug, "Starting the send loop.", EventName = "SendStarted")]
119[LoggerMessage(102, LogLevel.Debug, "Send loop canceled.", EventName = "SendCanceled")]
122[LoggerMessage(101, LogLevel.Debug, "Send loop stopped.", EventName = "SendStopped")]
125[LoggerMessage(103, LogLevel.Debug, "Sending {Count} bytes to the server using url: {Url}.", EventName = "SendingMessages")]
128[LoggerMessage(104, LogLevel.Debug, "Message(s) sent successfully.", EventName = "SentSuccessfully")]
131[LoggerMessage(105, LogLevel.Debug, "No messages in batch to send.", EventName = "NoMessages")]
134[LoggerMessage(106, LogLevel.Error, "Error while sending to '{Url}'.", EventName = "ErrorSending")]
Internal\ServerSentEventsTransport.Log.cs (9)
16[LoggerMessage(1, LogLevel.Information, "Starting transport. Transfer mode: {TransferFormat}.", EventName = "StartTransport")]
19[LoggerMessage(2, LogLevel.Debug, "Transport stopped.", EventName = "TransportStopped")]
22[LoggerMessage(3, LogLevel.Debug, "Starting receive loop.", EventName = "StartReceive")]
25[LoggerMessage(6, LogLevel.Information, "Transport is stopping.", EventName = "TransportStopping")]
28[LoggerMessage(7, LogLevel.Debug, "Passing message to application. Payload size: {Count}.", EventName = "MessageToApplication")]
31[LoggerMessage(5, LogLevel.Debug, "Receive loop canceled.", EventName = "ReceiveCanceled")]
34[LoggerMessage(4, LogLevel.Debug, "Receive loop stopped.", EventName = "ReceiveStopped")]
37[LoggerMessage(8, LogLevel.Debug, "Server-Sent Event Stream ended.", EventName = "EventStreamEnded")]
41[LoggerMessage(9, LogLevel.Debug, "Received {Count} bytes. Parsing SSE frame.", EventName = "ParsingSSE")]
Internal\WebSocketsTransport.Log.cs (22)
15[LoggerMessage(1, LogLevel.Information, "Starting transport. Transfer mode: {TransferFormat}. Url: '{WebSocketUrl}'.", EventName = "StartTransport")]
18[LoggerMessage(2, LogLevel.Debug, "Transport stopped.", EventName = "TransportStopped")]
21[LoggerMessage(3, LogLevel.Debug, "Starting receive loop.", EventName = "StartReceive")]
24[LoggerMessage(6, LogLevel.Information, "Transport is stopping.", EventName = "TransportStopping")]
27[LoggerMessage(10, LogLevel.Debug, "Passing message to application. Payload size: {Count}.", EventName = "MessageToApp")]
30[LoggerMessage(5, LogLevel.Debug, "Receive loop canceled.", EventName = "ReceiveCanceled")]
33[LoggerMessage(4, LogLevel.Debug, "Receive loop stopped.", EventName = "ReceiveStopped")]
36[LoggerMessage(7, LogLevel.Debug, "Starting the send loop.", EventName = "SendStarted")]
39[LoggerMessage(9, LogLevel.Debug, "Send loop canceled.", EventName = "SendCanceled")]
42[LoggerMessage(8, LogLevel.Debug, "Send loop stopped.", EventName = "SendStopped")]
45[LoggerMessage(11, LogLevel.Information, "WebSocket closed by the server. Close status {CloseStatus}.", EventName = "WebSocketClosed")]
48[LoggerMessage(12, LogLevel.Debug, "Message received. Type: {MessageType}, size: {Count}, EndOfMessage: {EndOfMessage}.", EventName = "MessageReceived")]
51[LoggerMessage(13, LogLevel.Debug, "Received message from application. Payload size: {Count}.", EventName = "ReceivedFromApp")]
54[LoggerMessage(14, LogLevel.Information, "Sending a message canceled.", EventName = "SendMessageCanceled")]
57[LoggerMessage(15, LogLevel.Error, "Error while sending a message.", EventName = "ErrorSendingMessage")]
60[LoggerMessage(16, LogLevel.Information, "Closing WebSocket.", EventName = "ClosingWebSocket")]
63[LoggerMessage(17, LogLevel.Debug, "Closing webSocket failed.", EventName = "ClosingWebSocketFailed")]
66[LoggerMessage(18, LogLevel.Debug, "Canceled passing message to application.", EventName = "CancelMessage")]
69[LoggerMessage(19, LogLevel.Debug, "Started transport.", EventName = "StartedTransport")]
72[LoggerMessage(20, LogLevel.Warning, $"Configuring request headers using {nameof(HttpConnectionOptions)}.{nameof(HttpConnectionOptions.Headers)} is not supported when using websockets transport " +
76[LoggerMessage(21, LogLevel.Debug, "Receive loop errored.", EventName = "ReceiveErrored")]
79[LoggerMessage(22, LogLevel.Debug, "Send loop errored.", EventName = "SendErrored")]
Microsoft.AspNetCore.Http.Connections.Tests (5)
Microsoft.AspNetCore.Http.Extensions (40)
RequestDelegateFactory.cs (11)
2647[LoggerMessage(RequestDelegateCreationLogging.RequestBodyIOExceptionEventId, LogLevel.Debug, RequestDelegateCreationLogging.RequestBodyIOExceptionMessage, EventName = RequestDelegateCreationLogging.RequestBodyIOExceptionEventName)]
2661[LoggerMessage(RequestDelegateCreationLogging.InvalidJsonRequestBodyEventId, LogLevel.Debug, RequestDelegateCreationLogging.InvalidJsonRequestBodyLogMessage, EventName = RequestDelegateCreationLogging.InvalidJsonRequestBodyEventName)]
2675[LoggerMessage(RequestDelegateCreationLogging.ParameterBindingFailedEventId, LogLevel.Debug, RequestDelegateCreationLogging.ParameterBindingFailedLogMessage, EventName = RequestDelegateCreationLogging.ParameterBindingFailedEventName)]
2689[LoggerMessage(RequestDelegateCreationLogging.RequiredParameterNotProvidedEventId, LogLevel.Debug, RequestDelegateCreationLogging.RequiredParameterNotProvidedLogMessage, EventName = RequestDelegateCreationLogging.RequiredParameterNotProvidedEventName)]
2703[LoggerMessage(RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventId, LogLevel.Debug, RequestDelegateCreationLogging.ImplicitBodyNotProvidedLogMessage, EventName = RequestDelegateCreationLogging.ImplicitBodyNotProvidedEventName)]
2717[LoggerMessage(RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventId, LogLevel.Debug, RequestDelegateCreationLogging.UnexpectedJsonContentTypeLogMessage, EventName = RequestDelegateCreationLogging.UnexpectedJsonContentTypeEventName)]
2731[LoggerMessage(RequestDelegateCreationLogging.UnexpectedFormContentTypeEventId, LogLevel.Debug, RequestDelegateCreationLogging.UnexpectedFormContentTypeLogMessage, EventName = RequestDelegateCreationLogging.UnexpectedFormContentTypeLogEventName)]
2745[LoggerMessage(RequestDelegateCreationLogging.InvalidFormRequestBodyEventId, LogLevel.Debug, RequestDelegateCreationLogging.InvalidFormRequestBodyLogMessage, EventName = RequestDelegateCreationLogging.InvalidFormRequestBodyEventName)]
2759[LoggerMessage(RequestDelegateCreationLogging.InvalidAntiforgeryTokenEventId, LogLevel.Debug, RequestDelegateCreationLogging.InvalidAntiforgeryTokenLogMessage, EventName = RequestDelegateCreationLogging.InvalidAntiforgeryTokenEventName)]
2773[LoggerMessage(RequestDelegateCreationLogging.FormDataMappingFailedEventId, LogLevel.Debug, RequestDelegateCreationLogging.FormDataMappingFailedLogMessage, EventName = RequestDelegateCreationLogging.FormDataMappingFailedEventName)]
2787[LoggerMessage(RequestDelegateCreationLogging.UnexpectedRequestWithoutBodyEventId, LogLevel.Debug, RequestDelegateCreationLogging.UnexpectedRequestWithoutBodyLogMessage, EventName = RequestDelegateCreationLogging.UnexpectedRequestWithoutBodyEventName)]
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (27)
163if (_logger.IsEnabled(LogLevel.Debug))
305if (_logger.IsEnabled(LogLevel.Debug))
353[LoggerMessage(1, LogLevel.Debug, "Begin resolve metadata graph for type '{Type}'.", EventName = nameof(StartResolveMetadataGraph))]
356[LoggerMessage(2, LogLevel.Debug, "End resolve metadata graph for type '{Type}'.", EventName = nameof(EndResolveMetadataGraph))]
359[LoggerMessage(3, LogLevel.Debug, "Cached metadata found for type '{Type}'.", EventName = nameof(Metadata))]
362[LoggerMessage(4, LogLevel.Debug, "No cached metadata graph for type '{Type}'.", EventName = nameof(NoMetadataFound))]
365[LoggerMessage(5, LogLevel.Debug, "Recursive type '{Type}' found in the resolution graph '{Chain}'.", EventName = nameof(RecursiveTypeFound))]
368[LoggerMessage(6, LogLevel.Debug, "'{Type}' identified as primitive.", EventName = nameof(PrimitiveType))]
371[LoggerMessage(7, LogLevel.Debug, "'{Type}' identified as dictionary.", EventName = nameof(DictionaryType))]
374[LoggerMessage(8, LogLevel.Debug, "'{Type}' identified as collection.", EventName = nameof(CollectionType))]
377[LoggerMessage(9, LogLevel.Debug, "'{Type}' identified as object.", EventName = nameof(ObjectType))]
380[LoggerMessage(10, LogLevel.Debug, "Constructor found for type '{Type}' with parameters '{Parameters}'.", EventName = nameof(ConstructorFound))]
383[LoggerMessage(11, LogLevel.Debug, "Constructor parameter '{Name}' of type '{ParameterType}' found for type '{Type}'.", EventName = nameof(ConstructorParameter))]
386[LoggerMessage(12, LogLevel.Debug, "Candidate property '{Name}' of type '{PropertyType}'.", EventName = nameof(CandidateProperty))]
389[LoggerMessage(13, LogLevel.Debug, "Candidate property {PropertyName} has a matching constructor parameter '{ConstructorParameterName}'.", EventName = nameof(MatchingConstructorParameterFound))]
392[LoggerMessage(14, LogLevel.Debug, "Candidate property or constructor parameter {PropertyName} defines a custom name '{CustomName}'.", EventName = nameof(CustomParameterNameMetadata))]
395[LoggerMessage(15, LogLevel.Debug, "Candidate property {Name} will not be mapped. It has been explicitly ignored.", EventName = nameof(IgnoredProperty))]
398[LoggerMessage(16, LogLevel.Debug, "Candidate property {Name} will not be mapped. It has no public setter.", EventName = nameof(NonPublicSetter))]
401[LoggerMessage(17, LogLevel.Debug, "Candidate property {Name} is marked as required.", EventName = nameof(PropertyRequired))]
404[LoggerMessage(18, LogLevel.Debug, "Metadata created for {Type}.", EventName = nameof(MetadataComputed))]
407[LoggerMessage(19, LogLevel.Debug, "Can not map type generic type definition '{Type}'.", EventName = nameof(GenericTypeDefinitionNotSupported))]
410[LoggerMessage(20, LogLevel.Debug, "Unable to select a constructor. Multiple public constructors found for type '{Type}'.", EventName = nameof(MultiplePublicConstructorsFound))]
413[LoggerMessage(21, LogLevel.Debug, "Can not map interface type '{Type}'.", EventName = nameof(InterfacesNotSupported))]
416[LoggerMessage(22, LogLevel.Debug, "Can not map abstract type '{Type}'.", EventName = nameof(AbstractClassesNotSupported))]
419[LoggerMessage(23, LogLevel.Debug, "Unable to select a constructor. No public constructors found for type '{Type}'.", EventName = nameof(NoPublicConstructorFound))]
422[LoggerMessage(24, LogLevel.Debug, "Can not map type '{Type}'. Constructor parameter {Name} of type {ParameterType} is not supported.", EventName = nameof(ConstructorParameterTypeNotSupported))]
425[LoggerMessage(25, LogLevel.Debug, "Can not map type '{Type}'. Property {Name} of type {PropertyType} is not supported.", EventName = nameof(PropertyTypeNotSupported))]
Microsoft.AspNetCore.Http.Extensions.Tests (33)
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
50Assert.Equal(LogLevel.Debug, logs[0].LogLevel);
58Assert.Equal(LogLevel.Debug, logs[1].LogLevel);
66Assert.Equal(LogLevel.Debug, logs[2].LogLevel);
74Assert.Equal(LogLevel.Debug, logs[3].LogLevel);
113Assert.Equal(LogLevel.Debug, logs[0].LogLevel);
121Assert.Equal(LogLevel.Debug, logs[1].LogLevel);
233Assert.Equal(LogLevel.Debug, logs[0].LogLevel);
241Assert.Equal(LogLevel.Debug, logs[1].LogLevel);
313Assert.Equal(LogLevel.Debug, logs[0].LogLevel);
321Assert.Equal(LogLevel.Debug, logs[1].LogLevel);
403Assert.Equal(LogLevel.Debug, logMessage.LogLevel);
452Assert.Equal(LogLevel.Debug, logMessage.LogLevel);
493Assert.Equal(LogLevel.Debug, logMessage.LogLevel);
531Assert.Equal(LogLevel.Debug, logMessage.LogLevel);
611Assert.Equal(LogLevel.Debug, logMessage.LogLevel);
Microsoft.AspNetCore.Http.Results (19)
src\Shared\ResultsHelpers\FileResultHelper.cs (6)
398[LoggerMessage(17, LogLevel.Debug, "Writing the requested range of bytes to the body.", EventName = "WritingRangeToBody")]
401[LoggerMessage(34, LogLevel.Debug,
406[LoggerMessage(35, LogLevel.Debug,
414[LoggerMessage(36, LogLevel.Debug,
422[LoggerMessage(37, LogLevel.Debug,
430[LoggerMessage(38, LogLevel.Debug,
Microsoft.AspNetCore.HttpLogging (13)
HttpLoggingExtensions.cs (9)
11LogLevel.Information,
17LogLevel.Information,
23[LoggerMessage(3, LogLevel.Information, "RequestBody: {Body}{Status}", EventName = "RequestBody")]
26[LoggerMessage(4, LogLevel.Information, "ResponseBody: {Body}", EventName = "ResponseBody")]
29[LoggerMessage(5, LogLevel.Debug, "Decode failure while converting body.", EventName = "DecodeFailure")]
32[LoggerMessage(6, LogLevel.Debug, "Unrecognized Content-Type for {Name} body.", EventName = "UnrecognizedMediaType")]
35[LoggerMessage(7, LogLevel.Debug, "No Content-Type header for {Name} body.", EventName = "NoMediaType")]
38[LoggerMessage(8, LogLevel.Information, "Duration: {Duration}ms", EventName = "Duration")]
42LogLevel.Information,
Microsoft.AspNetCore.HttpLogging.Tests (1)
Microsoft.AspNetCore.HttpOverrides (3)
Microsoft.AspNetCore.HttpsPolicy (7)
HttpsLoggingExtensions.cs (4)
10[LoggerMessage(1, LogLevel.Debug, "Redirecting to '{redirect}'.", EventName = "RedirectingToHttps")]
13[LoggerMessage(2, LogLevel.Debug, "Https port '{port}' loaded from configuration.", EventName = "PortLoadedFromConfig")]
16[LoggerMessage(3, LogLevel.Warning, "Failed to determine the https port for redirect.", EventName = "FailedToDeterminePort")]
19[LoggerMessage(5, LogLevel.Debug, "Https port '{httpsPort}' discovered from server endpoints.", EventName = "PortFromServer")]
Microsoft.AspNetCore.HttpsPolicy.Tests (14)
Microsoft.AspNetCore.Identity (7)
LoggingExtensions.cs (7)
8[LoggerMessage(0, LogLevel.Debug, "ValidateAsync failed: the expiration time is invalid.", EventName = "InvalidExpirationTime")]
11[LoggerMessage(1, LogLevel.Debug, "ValidateAsync failed: did not find expected UserId.", EventName = "UserIdsNotEquals")]
14[LoggerMessage(2, LogLevel.Debug, "ValidateAsync failed: did not find expected purpose. '{ActualPurpose}' does not match the expected purpose '{ExpectedPurpose}'.", EventName = "PurposeNotEquals")]
17[LoggerMessage(3, LogLevel.Debug, "ValidateAsync failed: unexpected end of input.", EventName = "UnexpectedEndOfInput")]
20[LoggerMessage(4, LogLevel.Debug, "ValidateAsync failed: did not find expected security stamp.", EventName = "SecurityStampNotEquals")]
23[LoggerMessage(5, LogLevel.Debug, "ValidateAsync failed: the expected stamp is not empty.", EventName = "SecurityStampIsNotEmpty")]
26[LoggerMessage(6, LogLevel.Debug, "ValidateAsync failed: unhandled exception was thrown.", EventName = "UnhandledException")]
Microsoft.AspNetCore.Identity.Specification.Tests (2)
Microsoft.AspNetCore.Identity.UI (4)
Microsoft.AspNetCore.InternalTesting (33)
AssemblyTestLog.cs (8)
60StartTestLog(output, className, out loggerFactory, LogLevel.Debug, testName);
63public IDisposable StartTestLog(ITestOutputHelper output, string className, out ILoggerFactory loggerFactory, LogLevel minLogLevel, [CallerMemberName] string testName = null) =>
66internal IDisposable StartTestLog(ITestOutputHelper output, string className, out ILoggerFactory loggerFactory, LogLevel minLogLevel, out string resolvedTestName, out string logOutputDirectory, [CallerMemberName] string testName = null)
94=> CreateLoggerFactory(output, className, LogLevel.Trace, testName, logStart);
97public ILoggerFactory CreateLoggerFactory(ITestOutputHelper output, string className, LogLevel minLogLevel, [CallerMemberName] string testName = null, DateTimeOffset? logStart = null)
101public IServiceProvider CreateLoggerServices(ITestOutputHelper output, string className, LogLevel minLogLevel, out string normalizedTestName, [CallerMemberName] string testName = null, DateTimeOffset? logStart = null)
105public IServiceProvider CreateLoggerServices(ITestOutputHelper output, string className, LogLevel minLogLevel, out string normalizedTestName, out string logOutputDirectory, [CallerMemberName] string testName = null, DateTimeOffset? logStart = null)
200builder.SetMinimumLevel(LogLevel.Trace);
Logging\TestLogger.cs (5)
13private readonly Func<LogLevel, bool> _filter;
20public TestLogger(string name, ITestSink sink, Func<LogLevel, bool> filter)
42public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
61public bool IsEnabled(LogLevel logLevel)
63return logLevel != LogLevel.None && _filter(logLevel);
Logging\XunitLoggerFactoryExtensions.cs (4)
19public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel)
25public static ILoggingBuilder AddXunit(this ILoggingBuilder builder, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
37public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel)
43public static ILoggerFactory AddXunit(this ILoggerFactory loggerFactory, ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
Logging\XunitLoggerProvider.cs (8)
15private readonly LogLevel _minLevel;
19: this(output, LogLevel.Trace)
23public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel)
28public XunitLoggerProvider(ITestOutputHelper output, LogLevel minLevel, DateTimeOffset? logStart)
49private readonly LogLevel _minLogLevel;
53public XunitLogger(ITestOutputHelper output, string category, LogLevel minLogLevel, DateTimeOffset? logStart)
62LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
116public bool IsEnabled(LogLevel logLevel)
Microsoft.AspNetCore.InternalTesting.Tests (17)
Microsoft.AspNetCore.Localization (2)
Microsoft.AspNetCore.Localization.Tests (2)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.Core (159)
Filters\DisableRequestSizeLimitFilter.cs (4)
62[LoggerMessage(1, LogLevel.Warning, "A request body size limit could not be applied. This server does not support the IHttpRequestBodySizeFeature.", EventName = "FeatureNotFound")]
65[LoggerMessage(2, LogLevel.Warning, "A request body size limit could not be applied. The IHttpRequestBodySizeFeature for the server is read-only.", EventName = "FeatureIsReadOnly")]
68[LoggerMessage(3, LogLevel.Debug, "The request body size limit has been disabled.", EventName = "RequestBodySizeLimitDisabled")]
71[LoggerMessage(4, LogLevel.Debug, "Execution of filter {OverriddenFilter} is preempted by filter {OverridingFilter} which is the most effective filter implementing policy {FilterPolicy}.", EventName = "NotMostEffectiveFilter")]
Filters\RequestSizeLimitFilter.cs (4)
64[LoggerMessage(1, LogLevel.Warning, "A request body size limit could not be applied. This server does not support the IHttpRequestBodySizeFeature.", EventName = "FeatureNotFound")]
67[LoggerMessage(2, LogLevel.Warning, "A request body size limit could not be applied. The IHttpRequestBodySizeFeature for the server is read-only.", EventName = "FeatureIsReadOnly")]
70[LoggerMessage(3, LogLevel.Debug, "The maximum request body size has been set to {RequestSize}.", EventName = "MaxRequestBodySizeSet")]
73[LoggerMessage(4, LogLevel.Debug, "Execution of filter {OverriddenFilter} is preempted by filter {OverridingFilter} which is the most effective filter implementing policy {FilterPolicy}.", EventName = "NotMostEffectiveFilter")]
Formatters\FormatFilter.cs (4)
172[LoggerMessage(1, LogLevel.Debug, "Could not find a media type for the format '{FormatFilterContentType}'.", EventName = "UnsupportedFormatFilterContentType")]
175[LoggerMessage(2, LogLevel.Debug, "Current action does not support the content type '{FormatFilterContentType}'. The supported content types are '{SupportedMediaTypes}'.", EventName = "ActionDoesNotSupportFormatFilterContentType")]
178[LoggerMessage(3, LogLevel.Debug, "Cannot apply content type '{FormatFilterContentType}' to the response as current action had explicitly set a preferred content type.", EventName = "CannotApplyFormatFilterContentType")]
181[LoggerMessage(5, LogLevel.Debug, "Current action does not explicitly specify any content types for the response.", EventName = "ActionDoesNotExplicitlySpecifyContentTypes")]
Infrastructure\ControllerActionInvoker.cs (11)
381if (_diagnosticListener.IsEnabled() || _logger.IsEnabled(LogLevel.Trace))
589if (!logger.IsEnabled(LogLevel.Debug))
599[LoggerMessage(1, LogLevel.Debug, "Executing controller factory for controller {Controller} ({AssemblyName})", EventName = "ControllerFactoryExecuting", SkipEnabledCheck = true)]
604if (!logger.IsEnabled(LogLevel.Debug))
614[LoggerMessage(2, LogLevel.Debug, "Executed controller factory for controller {Controller} ({AssemblyName})", EventName = "ControllerFactoryExecuted", SkipEnabledCheck = true)]
619if (logger.IsEnabled(LogLevel.Information))
626if (arguments != null && logger.IsEnabled(LogLevel.Trace))
639[LoggerMessage(101, LogLevel.Information, "Executing action method {ActionName} - Validation state: {ValidationState}", EventName = "ActionMethodExecuting", SkipEnabledCheck = true)]
642[LoggerMessage(102, LogLevel.Trace, "Executing action method {ActionName} with arguments ({Arguments})", EventName = "ActionMethodExecutingWithArguments", SkipEnabledCheck = true)]
647if (logger.IsEnabled(LogLevel.Information))
654[LoggerMessage(103, LogLevel.Information, "Executed action method {ActionName}, returned result {ActionResult} in {ElapsedMilliseconds}ms.", EventName = "ActionMethodExecuted", SkipEnabledCheck = true)]
Infrastructure\DefaultOutputFormatterSelector.cs (10)
290if (logger.IsEnabled(LogLevel.Debug))
297[LoggerMessage(2, LogLevel.Debug, "Selected output formatter '{OutputFormatter}' and content type '{ContentType}' to write the response.", EventName = "FormatterSelected", SkipEnabledCheck = true)]
300[LoggerMessage(4, LogLevel.Debug, "No information found on request to perform content negotiation.", EventName = "NoAcceptForNegotiation")]
303[LoggerMessage(5, LogLevel.Debug, "Could not find an output formatter based on content negotiation. Accepted types were ({AcceptTypes})", EventName = "NoFormatterFromNegotiation")]
306[LoggerMessage(6, LogLevel.Debug, "Attempting to select an output formatter based on Accept header '{AcceptHeader}'.", EventName = "SelectingOutputFormatterUsingAcceptHeader")]
309[LoggerMessage(7, LogLevel.Debug, "Attempting to select an output formatter based on Accept header '{AcceptHeader}' and explicitly specified content types '{ExplicitContentTypes}'. The content types in the accept header must be a subset of the explicitly set content types.", EventName = "SelectingOutputFormatterUsingAcceptHeaderAndExplicitContentTypes")]
312[LoggerMessage(8, LogLevel.Debug, "Attempting to select an output formatter without using a content type as no explicit content types were specified for the response.", EventName = "SelectingOutputFormatterWithoutUsingContentTypes")]
315[LoggerMessage(9, LogLevel.Debug, "Attempting to select the first output formatter in the output formatters list which supports a content type from the explicitly specified content types '{ExplicitContentTypes}'.", EventName = "SelectingOutputFormatterUsingContentTypes")]
318[LoggerMessage(10, LogLevel.Debug, "Attempting to select the first formatter in the output formatters list which can write the result.", EventName = "SelectingFirstCanWriteFormatter")]
321[LoggerMessage(11, LogLevel.Debug, "List of registered output formatters, in the following order: {OutputFormatters}", EventName = "RegisteredOutputFormatters")]
Infrastructure\ResourceInvoker.Log.cs (11)
22if (logger.IsEnabled(LogLevel.Information))
67[LoggerMessage(101, LogLevel.Information, "Route matched with {RouteData}. Executing action {ActionName}", EventName = "ActionExecuting", SkipEnabledCheck = true)]
70[LoggerMessage(102, LogLevel.Information, "Route matched with {RouteData}. Executing controller action with signature {MethodInfo} on controller {Controller} ({AssemblyName}).", EventName = "ControllerActionExecuting", SkipEnabledCheck = true)]
73[LoggerMessage(103, LogLevel.Information, "Route matched with {RouteData}. Executing page {PageName}", EventName = "PageExecuting", SkipEnabledCheck = true)]
76[LoggerMessage(3, LogLevel.Information, "Authorization failed for the request at filter '{AuthorizationFilter}'.", EventName = "AuthorizationFailure")]
79[LoggerMessage(4, LogLevel.Debug, "Request was short circuited at resource filter '{ResourceFilter}'.", EventName = "ResourceFilterShortCircuit")]
82[LoggerMessage(5, LogLevel.Trace, "Before executing action result {ActionResult}.", EventName = "BeforeExecutingActionResult")]
90[LoggerMessage(6, LogLevel.Trace, "After executing action result {ActionResult}.", EventName = "AfterExecutingActionResult")]
101if (logger.IsEnabled(LogLevel.Information))
114[LoggerMessage(104, LogLevel.Information, "Executed page {PageName} in {ElapsedMilliseconds}ms", EventName = "PageExecuted", SkipEnabledCheck = true)]
117[LoggerMessage(105, LogLevel.Information, "Executed action {ActionName} in {ElapsedMilliseconds}ms", EventName = "ActionExecuted", SkipEnabledCheck = true)]
ModelBinding\Binders\BodyModelBinder.cs (7)
204if (logger.IsEnabled(LogLevel.Debug))
211[LoggerMessage(1, LogLevel.Debug, "Selected input formatter '{InputFormatter}' for content type '{ContentType}'.", EventName = "InputFormatterSelected", SkipEnabledCheck = true)]
216if (logger.IsEnabled(LogLevel.Debug))
223[LoggerMessage(2, LogLevel.Debug, "Rejected input formatter '{InputFormatter}' for content type '{ContentType}'.", EventName = "InputFormatterRejected", SkipEnabledCheck = true)]
228if (logger.IsEnabled(LogLevel.Debug))
241[LoggerMessage(3, LogLevel.Debug, "No input formatter was found to support the content type '{ContentType}' for use with the [FromBody] attribute.", EventName = "NoInputFormatterSelected", SkipEnabledCheck = true)]
244[LoggerMessage(4, LogLevel.Debug, "To use model binding, remove the [FromBody] attribute from the property or parameter named '{ModelName}' with model type '{ModelType}'.", EventName = "RemoveFromBodyAttribute", SkipEnabledCheck = true)]
ModelBinding\ParameterBinder.Log.cs (15)
20if (!logger.IsEnabled(LogLevel.Debug))
55[LoggerMessage(22, LogLevel.Debug, "Attempting to bind parameter '{ParameterName}' of type '{ModelType}' ...", EventName = "AttemptingToBindParameter", SkipEnabledCheck = true)]
58[LoggerMessage(39, LogLevel.Debug, "Attempting to bind property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}' ...", EventName = "AttemptingToBindProperty", SkipEnabledCheck = true)]
66if (!logger.IsEnabled(LogLevel.Debug))
101[LoggerMessage(23, LogLevel.Debug, "Done attempting to bind parameter '{ParameterName}' of type '{ModelType}'.", EventName = "DoneAttemptingToBindParameter", SkipEnabledCheck = true)]
104[LoggerMessage(40, LogLevel.Debug, "Done attempting to bind property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}'.", EventName = "DoneAttemptingToBindProperty", SkipEnabledCheck = true)]
112if (!logger.IsEnabled(LogLevel.Debug))
148[LoggerMessage(26, LogLevel.Debug, "Attempting to validate the bound parameter '{ParameterName}' of type '{ModelType}' ...", EventName = "AttemptingToValidateParameter", SkipEnabledCheck = true)]
151[LoggerMessage(41, LogLevel.Debug, "Attempting to validate the bound property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}' ...", EventName = "AttemptingToValidateProperty", SkipEnabledCheck = true)]
159if (!logger.IsEnabled(LogLevel.Debug))
198[LoggerMessage(27, LogLevel.Debug, "Done attempting to validate the bound parameter '{ParameterName}' of type '{ModelType}'.", EventName = "DoneAttemptingToValidateParameter")]
201[LoggerMessage(42, LogLevel.Debug, "Done attempting to validate the bound property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}'.", EventName = "DoneAttemptingToValidateProperty")]
209if (!logger.IsEnabled(LogLevel.Debug))
245[LoggerMessage(47, LogLevel.Debug, "Skipped binding property '{PropertyContainerType}.{PropertyName}' since its binding information disallowed it for the current request.",
250[LoggerMessage(48, LogLevel.Debug, "Skipped binding parameter '{ParameterName}' since its binding information disallowed it for the current request.",
MvcCoreLoggerExtensions.cs (26)
27if (!logger.IsEnabled(LogLevel.Debug))
38if (!logger.IsEnabled(LogLevel.Debug))
49if (!logger.IsEnabled(LogLevel.Debug))
60if (!logger.IsEnabled(LogLevel.Debug))
71if (!logger.IsEnabled(LogLevel.Debug))
80[LoggerMessage(52, LogLevel.Trace, "{FilterType}: Before executing {Method} on filter {Filter}.", EventName = "BeforeExecutingMethodOnFilter")]
83[LoggerMessage(53, LogLevel.Trace, "{FilterType}: After executing {Method} on filter {Filter}.", EventName = "AfterExecutingMethodOnFilter")]
88if (logger.IsEnabled(LogLevel.Debug))
101[LoggerMessage(3, LogLevel.Debug, "No actions matched the current request. Route values: {RouteValues}", EventName = "NoActionsMatched", SkipEnabledCheck = true)]
104[LoggerMessage(5, LogLevel.Debug, "Request was short circuited at result filter '{ResultFilter}'.", EventName = "ResultFilterShortCircuit")]
107[LoggerMessage(4, LogLevel.Debug, "Request was short circuited at exception filter '{ExceptionFilter}'.", EventName = "ExceptionFilterShortCircuit")]
110[LoggerMessage(63, LogLevel.Debug, "Request was short circuited at action filter '{ActionFilter}'.", EventName = "ActionFilterShortCircuit")]
115if (!logger.IsEnabled(LogLevel.Debug))
147[LoggerMessage(15, LogLevel.Debug, "Could not find a value in the request with name '{ModelName}' for binding property '{PropertyContainerType}.{ModelFieldName}' of type '{ModelType}'.",
152[LoggerMessage(16, LogLevel.Debug, "Could not find a value in the request with name '{ModelName}' for binding parameter '{ModelFieldName}' of type '{ModelType}'.",
157[LoggerMessage(46, LogLevel.Debug, "Could not find a value in the request with name '{ModelName}' of type '{ModelType}'.", EventName = "FoundNoValueInRequest", SkipEnabledCheck = true)]
163[LoggerMessage(19, LogLevel.Debug,
170if (!logger.IsEnabled(LogLevel.Debug))
199[LoggerMessage(44, LogLevel.Debug, "Attempting to bind parameter '{ParameterName}' of type '{ModelType}' using the name '{ModelName}' in request data ...", EventName = "AttemptingToBindParameterModel", SkipEnabledCheck = true)]
202[LoggerMessage(13, LogLevel.Debug, "Attempting to bind property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}' using the name '{ModelName}' in request data ...", EventName = "AttemptingToBindPropertyModel", SkipEnabledCheck = true)]
205[LoggerMessage(24, LogLevel.Debug, "Attempting to bind model of type '{ModelType}' using the name '{ModelName}' in request data ...", EventName = "AttemptingToBindModel", SkipEnabledCheck = true)]
210if (!logger.IsEnabled(LogLevel.Debug))
237[LoggerMessage(14, LogLevel.Debug, "Done attempting to bind property '{PropertyContainerType}.{PropertyName}' of type '{ModelType}'.", EventName = "DoneAttemptingToBindPropertyModel")]
240[LoggerMessage(25, LogLevel.Debug, "Done attempting to bind model of type '{ModelType}' using the name '{ModelName}'.", EventName = "DoneAttemptingToBindModel", SkipEnabledCheck = true)]
243[LoggerMessage(45, LogLevel.Debug, "Done attempting to bind parameter '{ParameterName}' of type '{ModelType}'.", EventName = "DoneAttemptingToBindParameterModel", SkipEnabledCheck = true)]
260[LoggerMessage(1, LogLevel.Debug, "Execution plan of {FilterType} filters (in the following order): {Filters}", EventName = "FilterExecutionPlan", SkipEnabledCheck = true)]
src\Shared\ResultsHelpers\FileResultHelper.cs (6)
398[LoggerMessage(17, LogLevel.Debug, "Writing the requested range of bytes to the body.", EventName = "WritingRangeToBody")]
401[LoggerMessage(34, LogLevel.Debug,
406[LoggerMessage(35, LogLevel.Debug,
414[LoggerMessage(36, LogLevel.Debug,
422[LoggerMessage(37, LogLevel.Debug,
430[LoggerMessage(38, LogLevel.Debug,
Microsoft.AspNetCore.Mvc.Core.Test (3)
Microsoft.AspNetCore.Mvc.Cors (1)
Microsoft.AspNetCore.Mvc.Formatters.Xml (6)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (7)
Microsoft.AspNetCore.Mvc.Razor (10)
Compilation\DefaultViewCompiler.cs (4)
137[LoggerMessage(3, LogLevel.Debug, "Initializing Razor view compiler with compiled view: '{ViewName}'.", EventName = "ViewCompilerLocatedCompiledView")]
140[LoggerMessage(4, LogLevel.Debug, "Initializing Razor view compiler with no compiled views.", EventName = "ViewCompilerNoCompiledViewsFound")]
143[LoggerMessage(5, LogLevel.Trace, "Located compiled view for view at path '{Path}'.", EventName = "ViewCompilerLocatedCompiledViewForPath")]
146[LoggerMessage(7, LogLevel.Trace, "Could not find a file for view at path '{Path}'.", EventName = "ViewCompilerCouldNotFindFileAtPath")]
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (13)
RuntimeViewCompiler.cs (10)
337var startTimestamp = _logger.IsEnabled(LogLevel.Debug) ? Stopwatch.GetTimestamp() : 0;
411[LoggerMessage(1, LogLevel.Debug, "Compilation of the generated code for the Razor file at '{FilePath}' started.")]
414[LoggerMessage(2, LogLevel.Debug, "Compilation of the generated code for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms.")]
428[LoggerMessage(3, LogLevel.Debug, "Initializing Razor view compiler with compiled view: '{ViewName}'.")]
431[LoggerMessage(4, LogLevel.Debug, "Initializing Razor view compiler with no compiled views.")]
434[LoggerMessage(5, LogLevel.Trace, "Located compiled view for view at path '{Path}'.")]
437[LoggerMessage(6, LogLevel.Trace, "Invalidating compiled view for view at path '{Path}'.")]
440[LoggerMessage(7, LogLevel.Trace, "Could not find a file for view at path '{Path}'.")]
443[LoggerMessage(8, LogLevel.Trace, "Found file at path '{Path}'.")]
446[LoggerMessage(9, LogLevel.Trace, "Invalidating compiled view at path '{Path}' with a file since the checksum did not match.")]
Microsoft.AspNetCore.Mvc.RazorPages (23)
PageLoggerExtensions.cs (22)
19[LoggerMessage(101, LogLevel.Debug, "Executing page model factory for page {Page} ({AssemblyName})", EventName = "ExecutingModelFactory", SkipEnabledCheck = true)]
24if (!logger.IsEnabled(LogLevel.Debug))
34[LoggerMessage(102, LogLevel.Debug, "Executed page model factory for page {Page} ({AssemblyName})", EventName = "ExecutedModelFactory", SkipEnabledCheck = true)]
39if (!logger.IsEnabled(LogLevel.Debug))
49[LoggerMessage(103, LogLevel.Debug, "Executing page factory for page {Page} ({AssemblyName})", EventName = "ExecutingPageFactory", SkipEnabledCheck = true)]
54if (!logger.IsEnabled(LogLevel.Debug))
64[LoggerMessage(104, LogLevel.Debug, "Executed page factory for page {Page} ({AssemblyName})", EventName = "ExecutedPageFactory", SkipEnabledCheck = true)]
69if (!logger.IsEnabled(LogLevel.Debug))
79[LoggerMessage(105, LogLevel.Information, "Executing handler method {HandlerName} - ModelState is {ValidationState}", EventName = "ExecutingHandlerMethod", SkipEnabledCheck = true)]
82[LoggerMessage(106, LogLevel.Trace, "Executing handler method {HandlerName} with arguments ({Arguments})", EventName = "HandlerMethodExecutingWithArguments", SkipEnabledCheck = true)]
87if (logger.IsEnabled(LogLevel.Information))
95if (arguments != null && logger.IsEnabled(LogLevel.Trace))
108[LoggerMessage(107, LogLevel.Information, "Executing an implicit handler method - ModelState is {ValidationState}", EventName = "ExecutingImplicitHandlerMethod", SkipEnabledCheck = true)]
113if (logger.IsEnabled(LogLevel.Information))
121[LoggerMessage(108, LogLevel.Information, "Executed handler method {HandlerName}, returned result {ActionResult}.", EventName = "ExecutedHandlerMethod")]
126if (logger.IsEnabled(LogLevel.Information))
133[LoggerMessage(109, LogLevel.Information, "Executed an implicit handler method, returned result {ActionResult}.", EventName = "ExecutedImplicitHandlerMethod", SkipEnabledCheck = true)]
138if (logger.IsEnabled(LogLevel.Information))
144[LoggerMessage(1, LogLevel.Trace, "{FilterType}: Before executing {Method} on filter {Filter}.", EventName = "BeforeExecutingMethodOnFilter")]
147[LoggerMessage(2, LogLevel.Trace, "{FilterType}: After executing {Method} on filter {Filter}.", EventName = "AfterExecutingMethodOnFilter")]
150[LoggerMessage(3, LogLevel.Debug, "Request was short circuited at page filter '{PageFilter}'.", EventName = "PageFilterShortCircuited")]
155[LoggerMessage(4, LogLevel.Debug, "Skipping the execution of current filter as its not the most effective filter implementing the policy {FilterPolicy}.", EventName = "NotMostEffectiveFilter")]
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures (19)
PartialViewResultExecutor.cs (4)
192[LoggerMessage(1, LogLevel.Information, "Executing PartialViewResult, running view {PartialViewName}.", EventName = "PartialViewResultExecuting")]
195[LoggerMessage(2, LogLevel.Debug, "The partial view path '{PartialViewFilePath}' was found in {ElapsedMilliseconds}ms.", EventName = "PartialViewFound")]
203[LoggerMessage(3, LogLevel.Error, "The partial view '{PartialViewName}' was not found. Searched locations: {SearchedViewLocations}", EventName = "PartialViewNotFound")]
206[LoggerMessage(4, LogLevel.Information, "Executed PartialViewResult - view {PartialViewName} executed in {ElapsedMilliseconds}ms.", EventName = "PartialViewResultExecuted")]
ViewResultExecutor.cs (4)
192[LoggerMessage(1, LogLevel.Information, "Executing ViewResult, running view {ViewName}.", EventName = "ViewResultExecuting")]
195[LoggerMessage(2, LogLevel.Debug, "The view path '{ViewFilePath}' was found in {ElapsedMilliseconds}ms.", EventName = "ViewFound")]
203[LoggerMessage(3, LogLevel.Error, "The view '{ViewName}' was not found. Searched locations: {SearchedViewLocations}", EventName = "ViewNotFound")]
206[LoggerMessage(4, LogLevel.Information, "Executed ViewResult - view {ViewName} executed in {ElapsedMilliseconds}ms.", EventName = "ViewResultExecuted")]
Microsoft.AspNetCore.OutputCaching (13)
LoggerExtensions.cs (13)
14[LoggerMessage(1, LogLevel.Debug, "The 'IfNoneMatch' header of the request contains a value of *.", EventName = "NotModifiedIfNoneMatchStar")]
17[LoggerMessage(2, LogLevel.Debug, "The ETag {ETag} in the 'IfNoneMatch' header matched the ETag of a cached entry.",
21[LoggerMessage(3, LogLevel.Debug, "The last modified date of {LastModified} is before the date {IfModifiedSince} specified in the 'IfModifiedSince' header.",
25[LoggerMessage(4, LogLevel.Information, "The content requested has not been modified.", EventName = "NotModifiedServed")]
28[LoggerMessage(5, LogLevel.Information, "Serving response from cache.", EventName = "CachedResponseServed")]
31[LoggerMessage(6, LogLevel.Information, "No cached response available for this request and the 'only-if-cached' cache directive was specified.",
35[LoggerMessage(7, LogLevel.Information, "No cached response available for this request.", EventName = "NoResponseServed")]
38[LoggerMessage(8, LogLevel.Information, "The response has been cached.", EventName = "ResponseCached")]
41[LoggerMessage(9, LogLevel.Information, "The response could not be cached for this request.", EventName = "ResponseNotCached")]
44[LoggerMessage(10, LogLevel.Warning, "The response could not be cached for this request because the 'Content-Length' did not match the body length.",
48[LoggerMessage(11, LogLevel.Debug, "The response time of the entry is {ResponseTime} and has exceeded its expiry date.",
52[LoggerMessage(12, LogLevel.Error, "Unable to query output cache.", EventName = "UnableToQueryOutputCache")]
55[LoggerMessage(13, LogLevel.Error, "Unable to write to output-cache.", EventName = "UnableToWriteToOutputCache")]
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (3)
Microsoft.AspNetCore.OutputCaching.Tests (13)
TestUtils.cs (13)
289internal static LoggedMessage NotModifiedIfNoneMatchStar => new LoggedMessage(1, LogLevel.Debug);
290internal static LoggedMessage NotModifiedIfNoneMatchMatched => new LoggedMessage(2, LogLevel.Debug);
291internal static LoggedMessage NotModifiedIfModifiedSinceSatisfied => new LoggedMessage(3, LogLevel.Debug);
292internal static LoggedMessage NotModifiedServed => new LoggedMessage(4, LogLevel.Information);
293internal static LoggedMessage CachedResponseServed => new LoggedMessage(5, LogLevel.Information);
294internal static LoggedMessage GatewayTimeoutServed => new LoggedMessage(6, LogLevel.Information);
295internal static LoggedMessage NoResponseServed => new LoggedMessage(7, LogLevel.Information);
296internal static LoggedMessage ResponseCached => new LoggedMessage(8, LogLevel.Information);
297internal static LoggedMessage ResponseNotCached => new LoggedMessage(9, LogLevel.Information);
298internal static LoggedMessage ResponseContentLengthMismatchNotCached => new LoggedMessage(10, LogLevel.Warning);
299internal static LoggedMessage ExpirationExpiresExceeded => new LoggedMessage(11, LogLevel.Debug);
301private LoggedMessage(int evenId, LogLevel logLevel)
308internal LogLevel LogLevel { get; }
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
290[LoggerMessage(1, LogLevel.Debug, "Rate limits exceeded, rejecting this request.", EventName = "RequestRejectedLimitsExceeded")]
293[LoggerMessage(2, LogLevel.Debug, "This endpoint requires a rate limiting policy with name {PolicyName}, but no such policy exists.", EventName = "WarnMissingPolicy")]
296[LoggerMessage(3, LogLevel.Debug, "The request was canceled.", EventName = "RequestCanceled")]
Microsoft.AspNetCore.RateLimiting.Tests (1)
Microsoft.AspNetCore.RequestDecompression (5)
DefaultRequestDecompressionProvider.cs (5)
63[LoggerMessage(1, LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.", EventName = "NoContentEncoding")]
66[LoggerMessage(2, LogLevel.Debug, "Request decompression is not supported for multiple Content-Encodings.", EventName = "MultipleContentEncodingsSpecified")]
69[LoggerMessage(3, LogLevel.Debug, "No matching request decompression provider found.", EventName = "NoDecompressionProvider")]
74if (logger.IsEnabled(LogLevel.Debug))
80[LoggerMessage(4, LogLevel.Debug, "The request will be decompressed with '{ContentEncoding}'.", EventName = "DecompressingWith", SkipEnabledCheck = true)]
Microsoft.AspNetCore.RequestDecompression.Tests (12)
RequestDecompressionMiddlewareTests.cs (7)
153AssertLog(logMessage, LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.");
186AssertLog(logMessage, LogLevel.Debug, "Request decompression is not supported for multiple Content-Encodings.");
250AssertLog(logMessages.First(), LogLevel.Debug, $"The request will be decompressed with '{contentEncoding}'.");
251AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "The Content-Encoding header is empty or not specified. Skipping request decompression.");
660private static void AssertLog(WriteContext log, LogLevel level, string message)
669AssertLog(logMessage, LogLevel.Debug, $"The request will be decompressed with '{encoding}'.");
675AssertLog(logMessage, LogLevel.Debug, "No matching request decompression provider found.");
Microsoft.AspNetCore.ResponseCaching (29)
LoggerExtensions.cs (29)
14[LoggerMessage(1, LogLevel.Debug, "The request cannot be served from cache because it uses the HTTP method: {Method}.",
18[LoggerMessage(2, LogLevel.Debug, "The request cannot be served from cache because it contains an 'Authorization' header.",
22[LoggerMessage(3, LogLevel.Debug, "The request cannot be served from cache because it contains a 'no-cache' cache directive.",
26[LoggerMessage(4, LogLevel.Debug, "The request cannot be served from cache because it contains a 'no-cache' pragma directive.",
30[LoggerMessage(5, LogLevel.Debug, "Adding a minimum freshness requirement of {Duration} specified by the 'min-fresh' cache directive.",
34[LoggerMessage(6, LogLevel.Debug, "The age of the entry is {Age} and has exceeded the maximum age for shared caches of {SharedMaxAge} specified by the 's-maxage' cache directive.",
38[LoggerMessage(7, LogLevel.Debug, "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. " +
43[LoggerMessage(8, LogLevel.Debug, "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive. " +
48[LoggerMessage(9, LogLevel.Debug, "The age of the entry is {Age} and has exceeded the maximum age of {MaxAge} specified by the 'max-age' cache directive.", EventName = "ExpirationMaxAgeExceeded")]
51[LoggerMessage(10, LogLevel.Debug, "The response time of the entry is {ResponseTime} and has exceeded the expiry date of {Expired} specified by the 'Expires' header.",
55[LoggerMessage(11, LogLevel.Debug, "Response is not cacheable because it does not contain the 'public' cache directive.",
59[LoggerMessage(12, LogLevel.Debug, "Response is not cacheable because it or its corresponding request contains a 'no-store' cache directive.",
62[LoggerMessage(13, LogLevel.Debug, "Response is not cacheable because it contains a 'no-cache' cache directive.",
66[LoggerMessage(14, LogLevel.Debug, "Response is not cacheable because it contains a 'SetCookie' header.", EventName = "ResponseWithSetCookieNotCacheable")]
69[LoggerMessage(15, LogLevel.Debug, "Response is not cacheable because it contains a '.Vary' header with a value of *.",
73[LoggerMessage(16, LogLevel.Debug, "Response is not cacheable because it contains the 'private' cache directive.",
77[LoggerMessage(17, LogLevel.Debug, "Response is not cacheable because its status code {StatusCode} does not indicate success.",
81[LoggerMessage(18, LogLevel.Debug, "The 'IfNoneMatch' header of the request contains a value of *.", EventName = "NotModifiedIfNoneMatchStar")]
84[LoggerMessage(19, LogLevel.Debug, "The ETag {ETag} in the 'IfNoneMatch' header matched the ETag of a cached entry.",
88[LoggerMessage(20, LogLevel.Debug, "The last modified date of {LastModified} is before the date {IfModifiedSince} specified in the 'IfModifiedSince' header.",
92[LoggerMessage(21, LogLevel.Information, "The content requested has not been modified.", EventName = "NotModifiedServed")]
95[LoggerMessage(22, LogLevel.Information, "Serving response from cache.", EventName = "CachedResponseServed")]
98[LoggerMessage(23, LogLevel.Information, "No cached response available for this request and the 'only-if-cached' cache directive was specified.",
102[LoggerMessage(24, LogLevel.Information, "No cached response available for this request.", EventName = "NoResponseServed")]
105[LoggerMessage(25, LogLevel.Debug, "Vary by rules were updated. Headers: {Headers}, Query keys: {QueryKeys}", EventName = "VaryByRulesUpdated")]
108[LoggerMessage(26, LogLevel.Information, "The response has been cached.", EventName = "ResponseCached")]
111[LoggerMessage(27, LogLevel.Information, "The response could not be cached for this request.", EventName = "ResponseNotCached")]
114[LoggerMessage(28, LogLevel.Warning, "The response could not be cached for this request because the 'Content-Length' did not match the body length.",
118[LoggerMessage(29, LogLevel.Debug,
Microsoft.AspNetCore.ResponseCaching.Tests (31)
TestUtils.cs (31)
275internal static LoggedMessage RequestMethodNotCacheable => new LoggedMessage(1, LogLevel.Debug);
276internal static LoggedMessage RequestWithAuthorizationNotCacheable => new LoggedMessage(2, LogLevel.Debug);
277internal static LoggedMessage RequestWithNoCacheNotCacheable => new LoggedMessage(3, LogLevel.Debug);
278internal static LoggedMessage RequestWithPragmaNoCacheNotCacheable => new LoggedMessage(4, LogLevel.Debug);
279internal static LoggedMessage ExpirationMinFreshAdded => new LoggedMessage(5, LogLevel.Debug);
280internal static LoggedMessage ExpirationSharedMaxAgeExceeded => new LoggedMessage(6, LogLevel.Debug);
281internal static LoggedMessage ExpirationMustRevalidate => new LoggedMessage(7, LogLevel.Debug);
282internal static LoggedMessage ExpirationMaxStaleSatisfied => new LoggedMessage(8, LogLevel.Debug);
283internal static LoggedMessage ExpirationMaxAgeExceeded => new LoggedMessage(9, LogLevel.Debug);
284internal static LoggedMessage ExpirationExpiresExceeded => new LoggedMessage(10, LogLevel.Debug);
285internal static LoggedMessage ResponseWithoutPublicNotCacheable => new LoggedMessage(11, LogLevel.Debug);
286internal static LoggedMessage ResponseWithNoStoreNotCacheable => new LoggedMessage(12, LogLevel.Debug);
287internal static LoggedMessage ResponseWithNoCacheNotCacheable => new LoggedMessage(13, LogLevel.Debug);
288internal static LoggedMessage ResponseWithSetCookieNotCacheable => new LoggedMessage(14, LogLevel.Debug);
289internal static LoggedMessage ResponseWithVaryStarNotCacheable => new LoggedMessage(15, LogLevel.Debug);
290internal static LoggedMessage ResponseWithPrivateNotCacheable => new LoggedMessage(16, LogLevel.Debug);
291internal static LoggedMessage ResponseWithUnsuccessfulStatusCodeNotCacheable => new LoggedMessage(17, LogLevel.Debug);
292internal static LoggedMessage NotModifiedIfNoneMatchStar => new LoggedMessage(18, LogLevel.Debug);
293internal static LoggedMessage NotModifiedIfNoneMatchMatched => new LoggedMessage(19, LogLevel.Debug);
294internal static LoggedMessage NotModifiedIfModifiedSinceSatisfied => new LoggedMessage(20, LogLevel.Debug);
295internal static LoggedMessage NotModifiedServed => new LoggedMessage(21, LogLevel.Information);
296internal static LoggedMessage CachedResponseServed => new LoggedMessage(22, LogLevel.Information);
297internal static LoggedMessage GatewayTimeoutServed => new LoggedMessage(23, LogLevel.Information);
298internal static LoggedMessage NoResponseServed => new LoggedMessage(24, LogLevel.Information);
299internal static LoggedMessage VaryByRulesUpdated => new LoggedMessage(25, LogLevel.Debug);
300internal static LoggedMessage ResponseCached => new LoggedMessage(26, LogLevel.Information);
301internal static LoggedMessage ResponseNotCached => new LoggedMessage(27, LogLevel.Information);
302internal static LoggedMessage ResponseContentLengthMismatchNotCached => new LoggedMessage(28, LogLevel.Warning);
303internal static LoggedMessage ExpirationInfiniteMaxStaleSatisfied => new LoggedMessage(29, LogLevel.Debug);
305private LoggedMessage(int evenId, LogLevel logLevel)
312internal LogLevel LogLevel { get; }
Microsoft.AspNetCore.ResponseCompression (8)
ResponseCompressionLoggingExtensions.cs (8)
10[LoggerMessage(1, LogLevel.Debug, "No response compression available, the Accept-Encoding header is missing or invalid.", EventName = "NoAcceptEncoding")]
13[LoggerMessage(2, LogLevel.Debug, "No response compression available for HTTPS requests. See ResponseCompressionOptions.EnableForHttps.", EventName = "NoCompressionForHttps")]
16[LoggerMessage(3, LogLevel.Trace, "This request accepts compression.", EventName = "RequestAcceptsCompression")]
19[LoggerMessage(4, LogLevel.Debug, "Response compression disabled due to the {header} header.", EventName = "NoCompressionDueToHeader")]
22[LoggerMessage(5, LogLevel.Debug, "Response compression is not enabled for the Content-Type '{header}'.", EventName = "NoCompressionForContentType")]
25[LoggerMessage(6, LogLevel.Trace, "Response compression is available for this Content-Type.", EventName = "ShouldCompressResponse")]
28[LoggerMessage(7, LogLevel.Debug, "No matching response compression provider found.", EventName = "NoCompressionProvider")]
31[LoggerMessage(8, LogLevel.Debug, "The response will be compressed with '{provider}'.", EventName = "CompressWith")]
Microsoft.AspNetCore.ResponseCompression.Tests (28)
ResponseCompressionMiddlewareTest.cs (28)
54AssertLog(logMessages.Single(), LogLevel.Debug, "No response compression available, the Accept-Encoding header is missing or invalid.");
110AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
111AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type.");
112AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found.");
121AssertLog(logMessages.Single(), LogLevel.Debug, "No response compression available, the Accept-Encoding header is missing or invalid.");
194AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
196AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, $"Response compression is not enabled for the Content-Type '{expected}'.");
282AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
283AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, $"Response compression is not enabled for the Content-Type '{contentType}'.");
359AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
360AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type.");
361AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found.");
384AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
385AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type.");
386AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, "No matching response compression provider found.");
396AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
397AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression is not enabled for the Content-Type 'text/custom'.");
410AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
411AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression disabled due to the Content-Range header.");
428AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
429AssertLog(logMessages.Skip(1).First(), LogLevel.Debug, "Response compression disabled due to the Content-Encoding header.");
488AssertLog(logMessages.Skip(1).Single(), LogLevel.Debug, "No response compression available for HTTPS requests. See ResponseCompressionOptions.EnableForHttps.");
551AssertLog(logMessages.Skip(1).Single(), LogLevel.Debug, "No response compression available for HTTPS requests. See ResponseCompressionOptions.EnableForHttps.");
610AssertLog(logMessages.Skip(1).Single(), LogLevel.Debug, "No response compression available for HTTPS requests. See ResponseCompressionOptions.EnableForHttps.");
1330private static void AssertLog(WriteContext log, LogLevel level, string message)
1339AssertLog(logMessages.First(), LogLevel.Trace, "This request accepts compression.");
1340AssertLog(logMessages.Skip(1).First(), LogLevel.Trace, "Response compression is available for this Content-Type.");
1341AssertLog(logMessages.Skip(2).First(), LogLevel.Debug, $"The response will be compressed with '{provider}'.");
Microsoft.AspNetCore.Rewrite (14)
Extensions\RewriteMiddlewareLoggingExtensions.cs (14)
10[LoggerMessage(1, LogLevel.Debug, "Request is continuing in applying rules. Current url is {currentUrl}", EventName = "RequestContinueResults")]
13[LoggerMessage(2, LogLevel.Debug, "Request is done processing. Location header '{Location}' with status code '{StatusCode}'.", EventName = "RequestResponseComplete")]
16[LoggerMessage(3, LogLevel.Debug, "Request is done applying rules. Url was rewritten to {rewrittenUrl}", EventName = "RequestStopRules")]
19[LoggerMessage(4, LogLevel.Debug, "Request did not match current rule '{Name}'.", EventName = "UrlRewriteNotMatchedRule")]
22[LoggerMessage(5, LogLevel.Debug, "Request matched current UrlRewriteRule '{Name}'.", EventName = "UrlRewriteMatchedRule")]
25[LoggerMessage(6, LogLevel.Debug, "Request matched current ModRewriteRule.", EventName = "ModRewriteNotMatchedRule")]
28[LoggerMessage(7, LogLevel.Debug, "Request matched current ModRewriteRule.", EventName = "ModRewriteMatchedRule")]
31[LoggerMessage(8, LogLevel.Information, "Request redirected to HTTPS", EventName = "RedirectedToHttps")]
34[LoggerMessage(13, LogLevel.Information, "Request redirected to www", EventName = "RedirectedToWww")]
37[LoggerMessage(14, LogLevel.Information, "Request redirected to root domain from www subdomain", EventName = "RedirectedToNonWww")]
39[LoggerMessage(9, LogLevel.Information, "Request was redirected to {redirectedUrl}", EventName = "RedirectedRequest")]
42[LoggerMessage(10, LogLevel.Information, "Request was rewritten to {rewrittenUrl}", EventName = "RewritetenRequest")]
45[LoggerMessage(11, LogLevel.Debug, "Request to {requestedUrl} was aborted", EventName = "AbortedRequest")]
48[LoggerMessage(12, LogLevel.Debug, "Request to {requestedUrl} was ended", EventName = "CustomResponse")]
Microsoft.AspNetCore.Routing (54)
DefaultLinkGenerator.cs (14)
342if (logger.IsEnabled(LogLevel.Debug))
348[LoggerMessage(100, LogLevel.Debug, "Found the endpoints {Endpoints} for address {Address}", EventName = "EndpointsFound", SkipEnabledCheck = true)]
351[LoggerMessage(101, LogLevel.Debug, "No endpoints found for address {Address}", EventName = "EndpointsNotFound")]
357[LoggerMessage(102, LogLevel.Debug,
365if (logger.IsEnabled(LogLevel.Debug))
371[LoggerMessage(103, LogLevel.Debug,
382if (logger.IsEnabled(LogLevel.Debug))
388[LoggerMessage(107, LogLevel.Debug,
398if (logger.IsEnabled(LogLevel.Debug))
404[LoggerMessage(104, LogLevel.Debug,
415if (logger.IsEnabled(LogLevel.Debug))
421[LoggerMessage(105, LogLevel.Debug,
430if (logger.IsEnabled(LogLevel.Debug))
436[LoggerMessage(106, LogLevel.Debug, "Link generation failed for endpoints {Endpoints}", EventName = "LinkGenerationFailed", SkipEnabledCheck = true)]
DefaultLinkParser.cs (7)
175if (logger.IsEnabled(LogLevel.Debug))
181[LoggerMessage(100, LogLevel.Debug, "Found the endpoints {Endpoints} for address {Address}", EventName = "EndpointsFound", SkipEnabledCheck = true)]
184[LoggerMessage(101, LogLevel.Debug, "No endpoints found for address {Address}", EventName = "EndpointsNotFound")]
190if (logger.IsEnabled(LogLevel.Debug))
196[LoggerMessage(102, LogLevel.Debug, "Path parsing succeeded for endpoint {Endpoint} and URI path {URI}", EventName = "PathParsingSucceeded", SkipEnabledCheck = true)]
202if (logger.IsEnabled(LogLevel.Debug))
208[LoggerMessage(103, LogLevel.Debug, "Path parsing failed for endpoints {Endpoints} and URI path {URI}", EventName = "PathParsingFailed", SkipEnabledCheck = true)]
EndpointRoutingMiddleware.cs (14)
118if (_logger.IsEnabled(LogLevel.Debug) || _metrics.MatchSuccessCounterEnabled)
188if (!_logger.IsEnabled(LogLevel.Information))
342[LoggerMessage(1, LogLevel.Debug, "Request matched endpoint '{EndpointName}'", EventName = "MatchSuccess")]
345[LoggerMessage(2, LogLevel.Debug, "Request did not match any endpoints", EventName = "MatchFailure")]
351[LoggerMessage(3, LogLevel.Debug, "Endpoint '{EndpointName}' already set, skipping route matching.", EventName = "MatchingSkipped")]
354[LoggerMessage(4, LogLevel.Information, "The endpoint '{EndpointName}' is being executed without running additional middleware.", EventName = "ExecutingEndpoint")]
357[LoggerMessage(5, LogLevel.Information, "The endpoint '{EndpointName}' has been executed without running additional middleware.", EventName = "ExecutedEndpoint")]
360[LoggerMessage(6, LogLevel.Information, "The endpoint '{EndpointName}' is being short circuited without running additional middleware or producing a response.", EventName = "ShortCircuitedEndpoint")]
363[LoggerMessage(7, LogLevel.Debug, "Matched endpoint '{EndpointName}' is a fallback endpoint.", EventName = "FallbackMatch")]
366[LoggerMessage(8, LogLevel.Trace, $"The endpoint does not specify the {nameof(IRequestSizeLimitMetadata)}.", EventName = "RequestSizeLimitMetadataNotFound")]
369[LoggerMessage(9, LogLevel.Warning, $"A request body size limit could not be applied. This server does not support the {nameof(IHttpMaxRequestBodySizeFeature)}.", EventName = "RequestSizeFeatureNotFound")]
372[LoggerMessage(10, LogLevel.Warning, $"A request body size limit could not be applied. The {nameof(IHttpMaxRequestBodySizeFeature)} for the server is read-only.", EventName = "RequestSizeFeatureIsReadOnly")]
375[LoggerMessage(11, LogLevel.Debug, "The maximum request body size has been set to {RequestSize}.", EventName = "MaxRequestBodySizeSet")]
378[LoggerMessage(12, LogLevel.Debug, "The maximum request body size has been disabled.", EventName = "MaxRequestBodySizeDisabled")]
Matching\DfaMatcher.cs (11)
37var log = _logger.IsEnabled(LogLevel.Debug);
349[LoggerMessage(1000, LogLevel.Debug,
358[LoggerMessage(1001, LogLevel.Debug,
367if (logger.IsEnabled(LogLevel.Debug))
374[LoggerMessage(1002, LogLevel.Debug,
383if (logger.IsEnabled(LogLevel.Debug))
390[LoggerMessage(1003, LogLevel.Debug,
399if (logger.IsEnabled(LogLevel.Debug))
406[LoggerMessage(1004, LogLevel.Debug,
415if (logger.IsEnabled(LogLevel.Debug))
422[LoggerMessage(1005, LogLevel.Debug,
Microsoft.AspNetCore.Routing.Tests (3)
Microsoft.AspNetCore.Server.HttpSys (58)
AsyncAcceptContext.Log.cs (4)
12[LoggerMessage(LoggerEventIds.AcceptSetResultFailed, LogLevel.Error, "Error attempting to set 'accept' outcome", EventName = "AcceptSetResultFailed")]
17[LoggerMessage(LoggerEventIds.AcceptSetExpectationMismatch, LogLevel.Critical, "Mismatch setting callback expectation - {Value}", EventName = "AcceptSetExpectationMismatch")]
20[LoggerMessage(LoggerEventIds.AcceptCancelExpectationMismatch, LogLevel.Critical, "Mismatch canceling accept state - {Value}", EventName = "AcceptCancelExpectationMismatch")]
23[LoggerMessage(LoggerEventIds.AcceptObserveExpectationMismatch, LogLevel.Critical, "Mismatch observing {Kind} accept callback - {Value}", EventName = "AcceptObserveExpectationMismatch")]
HttpSysListener.Log.cs (8)
12[LoggerMessage(LoggerEventIds.ListenerDisposeError, LogLevel.Error, "Dispose", EventName = "ListenerDisposeError")]
15[LoggerMessage(LoggerEventIds.ListenerDisposing, LogLevel.Trace, "Disposing the listener.", EventName = "ListenerDisposing")]
18[LoggerMessage(LoggerEventIds.HttpSysListenerCtorError, LogLevel.Error, ".Ctor", EventName = "HttpSysListenerCtorError")]
21[LoggerMessage(LoggerEventIds.ListenerStartError, LogLevel.Error, "Start", EventName = "ListenerStartError")]
24[LoggerMessage(LoggerEventIds.ListenerStarting, LogLevel.Trace, "Starting the listener.", EventName = "ListenerStarting")]
27[LoggerMessage(LoggerEventIds.ListenerStopError, LogLevel.Error, "Stop", EventName = "ListenerStopError")]
30[LoggerMessage(LoggerEventIds.ListenerStopping, LogLevel.Trace, "Stopping the listener.", EventName = "ListenerStopping")]
33[LoggerMessage(LoggerEventIds.RequestValidationFailed, LogLevel.Error, "Error validating request {RequestId}", EventName = "RequestValidationFailed")]
MessagePump.Log.cs (10)
14[LoggerMessage(LoggerEventIds.AcceptError, LogLevel.Error, "Failed to accept a request.", EventName = "AcceptError")]
17[LoggerMessage(LoggerEventIds.AcceptErrorStopping, LogLevel.Debug, "Failed to accept a request, the server is stopping.", EventName = "AcceptErrorStopping")]
20[LoggerMessage(LoggerEventIds.BindingToDefault, LogLevel.Debug, $"No listening endpoints were configured. Binding to {Constants.DefaultServerAddress} by default.", EventName = "BindingToDefault")]
25if (logger.IsEnabled(LogLevel.Warning))
31[LoggerMessage(LoggerEventIds.ClearedAddresses, LogLevel.Warning,
39if (logger.IsEnabled(LogLevel.Warning))
45[LoggerMessage(LoggerEventIds.ClearedPrefixes, LogLevel.Warning,
51[LoggerMessage(LoggerEventIds.RequestListenerProcessError, LogLevel.Error, "ProcessRequestAsync", EventName = "RequestListenerProcessError")]
54[LoggerMessage(LoggerEventIds.StopCancelled, LogLevel.Information, "Canceled, terminating {OutstandingRequests} request(s).", EventName = "StopCancelled")]
57[LoggerMessage(LoggerEventIds.WaitingForRequestsToDrain, LogLevel.Information, "Stopping, waiting for {OutstandingRequests} request(s) to drain.", EventName = "WaitingForRequestsToDrain")]
NativeInterop\DisconnectListener.Log.cs (6)
12[LoggerMessage(LoggerEventIds.DisconnectHandlerError, LogLevel.Error, "CreateDisconnectToken Callback", EventName = "DisconnectHandlerError")]
15[LoggerMessage(LoggerEventIds.DisconnectRegistrationError, LogLevel.Error, "Unable to register for disconnect notifications.", EventName = "DisconnectRegistrationError")]
18[LoggerMessage(LoggerEventIds.CreateDisconnectTokenError, LogLevel.Error, "CreateDisconnectToken", EventName = "CreateDisconnectTokenError")]
21[LoggerMessage(LoggerEventIds.DisconnectTriggered, LogLevel.Debug, "CreateDisconnectToken; http.sys disconnect callback fired for connection ID: {ConnectionId}", EventName = "DisconnectTriggered")]
24[LoggerMessage(LoggerEventIds.RegisterDisconnectListener, LogLevel.Debug, "CreateDisconnectToken; Registering connection for disconnect for connection ID: {ConnectionId}", EventName = "RegisterDisconnectListener")]
27[LoggerMessage(LoggerEventIds.UnknownDisconnectError, LogLevel.Debug, "HttpWaitForDisconnectEx", EventName = "UnknownDisconnectError")]
NativeInterop\UrlGroup.Log.cs (4)
12[LoggerMessage(LoggerEventIds.CloseUrlGroupError, LogLevel.Error, "HttpCloseUrlGroup; Result: {StatusCode}", EventName = "CloseUrlGroupError")]
15[LoggerMessage(LoggerEventIds.RegisteringPrefix, LogLevel.Debug, "Listening on prefix: {UriPrefix}", EventName = "RegisteringPrefix")]
18[LoggerMessage(LoggerEventIds.SetUrlPropertyError, LogLevel.Error, "SetUrlGroupProperty", EventName = "SetUrlPropertyError")]
21[LoggerMessage(LoggerEventIds.UnregisteringPrefix, LogLevel.Information, "Stop listening on prefix: {UriPrefix}", EventName = "UnregisteringPrefix")]
RequestProcessing\RequestContext.Log.cs (4)
12[LoggerMessage(LoggerEventIds.AbortError, LogLevel.Debug, "Abort", EventName = "AbortError")]
15[LoggerMessage(LoggerEventIds.ChannelBindingNeedsHttps, LogLevel.Debug, "TryGetChannelBinding; Channel binding requires HTTPS.", EventName = "ChannelBindingNeedsHttps")]
18[LoggerMessage(LoggerEventIds.ChannelBindingRetrieved, LogLevel.Debug, "Channel binding retrieved.", EventName = "ChannelBindingRetrieved")]
21[LoggerMessage(LoggerEventIds.RequestParsingError, LogLevel.Debug, "Failed to parse request.", EventName = "RequestParsingError")]
RequestProcessing\RequestContextLog.cs (4)
10[LoggerMessage(LoggerEventIds.RequestError, LogLevel.Error, "ProcessRequestAsync", EventName = "RequestError")]
13[LoggerMessage(LoggerEventIds.RequestProcessError, LogLevel.Error, "ProcessRequestAsync", EventName = "RequestProcessError")]
16[LoggerMessage(LoggerEventIds.RequestsDrained, LogLevel.Information, "All requests drained.", EventName = "RequestsDrained")]
19[LoggerMessage(LoggerEventIds.RequestAborted, LogLevel.Debug, "The request was aborted by the client.", EventName = "RequestAborted")]
RequestProcessing\ResponseBody.cs (8)
786[LoggerMessage(LoggerEventIds.FewerBytesThanExpected, LogLevel.Error, "ResponseStream::Dispose; Fewer bytes were written than were specified in the Content-Length.", EventName = "FewerBytesThanExpected")]
789[LoggerMessage(LoggerEventIds.WriteError, LogLevel.Error, "Flush", EventName = "WriteError")]
792[LoggerMessage(LoggerEventIds.WriteErrorIgnored, LogLevel.Debug, "Flush; Ignored write exception: {StatusCode}", EventName = "WriteFlushedIgnored")]
795[LoggerMessage(LoggerEventIds.ErrorWhenFlushAsync, LogLevel.Debug, "FlushAsync", EventName = "ErrorWhenFlushAsync")]
798[LoggerMessage(LoggerEventIds.WriteFlushCancelled, LogLevel.Debug, "FlushAsync; Write cancelled with error code: {StatusCode}", EventName = "WriteFlushCancelled")]
801[LoggerMessage(LoggerEventIds.FileSendAsyncError, LogLevel.Error, "SendFileAsync", EventName = "FileSendAsyncError")]
804[LoggerMessage(LoggerEventIds.FileSendAsyncCancelled, LogLevel.Debug, "SendFileAsync; Write cancelled with error code: {StatusCode}", EventName = "FileSendAsyncCancelled")]
807[LoggerMessage(LoggerEventIds.FileSendAsyncErrorIgnored, LogLevel.Debug, "SendFileAsync; Ignored write exception: {StatusCode}", EventName = "FileSendAsyncErrorIgnored")]
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (4)
Microsoft.AspNetCore.Server.IIS (6)
Core\IISHttpContext.Log.cs (5)
13[LoggerMessage(1, LogLevel.Debug, @"Connection ID ""{ConnectionId}"" disconnecting.", EventName = "ConnectionDisconnect")]
16[LoggerMessage(2, LogLevel.Error, @"Connection ID ""{ConnectionId}"", Request ID ""{TraceIdentifier}"": An unhandled exception was thrown by the application.", EventName = "ApplicationError")]
19[LoggerMessage(3, LogLevel.Error, @"Unexpected exception in ""{ClassName}.{MethodName}"".", EventName = "UnexpectedError")]
25[LoggerMessage(4, LogLevel.Debug, @"Connection id ""{ConnectionId}"" bad request data: ""{message}""", EventName = nameof(ConnectionBadRequest))]
28[LoggerMessage(5, LogLevel.Debug, @"Connection ID ""{ConnectionId}"", Request ID ""{TraceIdentifier}"": The request was aborted by the client.", EventName = "RequestAborted")]
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
Microsoft.AspNetCore.Server.Kestrel.Core (115)
Internal\CertificatePathWatcherLoggerExtensions.cs (16)
10[LoggerMessage(1, LogLevel.Warning, "Directory '{Directory}' does not exist so changes to the certificate '{Path}' will not be tracked.", EventName = "DirectoryDoesNotExist")]
13[LoggerMessage(2, LogLevel.Warning, "Attempted to remove watch from unwatched path '{Path}'.", EventName = "UnknownFile")]
16[LoggerMessage(3, LogLevel.Warning, "Attempted to remove unknown observer from path '{Path}'.", EventName = "UnknownObserver")]
19[LoggerMessage(4, LogLevel.Debug, "Created directory watcher for '{Directory}'.", EventName = "CreatedDirectoryWatcher")]
22[LoggerMessage(5, LogLevel.Debug, "Created file watcher for '{Path}'.", EventName = "CreatedFileWatcher")]
25[LoggerMessage(6, LogLevel.Debug, "Removed directory watcher for '{Directory}'.", EventName = "RemovedDirectoryWatcher")]
28[LoggerMessage(7, LogLevel.Debug, "Removed file watcher for '{Path}'.", EventName = "RemovedFileWatcher")]
31[LoggerMessage(8, LogLevel.Debug, "Error retrieving last modified time for '{Path}'.", EventName = "LastModifiedTimeError")]
34[LoggerMessage(9, LogLevel.Debug, "Ignored event for presently untracked file '{Path}'.", EventName = "UntrackedFileEvent")]
37[LoggerMessage(10, LogLevel.Trace, "Reused existing observer on file watcher for '{Path}'.", EventName = "ReusedObserver")]
40[LoggerMessage(11, LogLevel.Trace, "Added observer to file watcher for '{Path}'.", EventName = "AddedObserver")]
43[LoggerMessage(12, LogLevel.Trace, "Removed observer from file watcher for '{Path}'.", EventName = "RemovedObserver")]
46[LoggerMessage(13, LogLevel.Trace, "File '{Path}' now has {Count} observers.", EventName = "ObserverCount")]
49[LoggerMessage(14, LogLevel.Trace, "Directory '{Directory}' now has watchers on {Count} files.", EventName = "FileCount")]
52[LoggerMessage(15, LogLevel.Trace, "Flagged {Count} observers of '{Path}' as changed.", EventName = "FlaggedObservers")]
55[LoggerMessage(16, LogLevel.Trace, "Ignored event since '{Path}' was unavailable.", EventName = "EventWithoutFile")]
Internal\Infrastructure\KestrelTrace.BadRequests.cs (6)
33if (_generalLogger.IsEnabled(LogLevel.Debug))
41[LoggerMessage(17, LogLevel.Debug, @"Connection id ""{ConnectionId}"" bad request data: ""{message}""", EventName = "ConnectionBadRequest")]
44[LoggerMessage(20, LogLevel.Debug, @"Connection id ""{ConnectionId}"" request processing ended abnormally.", EventName = "RequestProcessingError")]
47[LoggerMessage(27, LogLevel.Debug, @"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.", EventName = "RequestBodyMinimumDataRateNotSatisfied")]
50[LoggerMessage(28, LogLevel.Debug, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the connection was closed because the response was not read by the client at the specified minimum data rate.", EventName = "ResponseMinimumDataRateNotSatisfied")]
53[LoggerMessage(54, LogLevel.Debug, @"Connection id ""{ConnectionId}"": Invalid content received on connection. Possible incorrect HTTP version detected. Expected {ExpectedHttpVersion} but received {DetectedHttpVersion}.", EventName = "PossibleInvalidHttpVersionDetected", SkipEnabledCheck = true)]
Internal\Infrastructure\KestrelTrace.Connections.cs (11)
67[LoggerMessage(1, LogLevel.Debug, @"Connection id ""{ConnectionId}"" started.", EventName = "ConnectionStart")]
70[LoggerMessage(2, LogLevel.Debug, @"Connection id ""{ConnectionId}"" stopped.", EventName = "ConnectionStop")]
73[LoggerMessage(4, LogLevel.Debug, @"Connection id ""{ConnectionId}"" paused.", EventName = "ConnectionPause")]
76[LoggerMessage(5, LogLevel.Debug, @"Connection id ""{ConnectionId}"" resumed.", EventName = "ConnectionResume")]
79[LoggerMessage(9, LogLevel.Debug, @"Connection id ""{ConnectionId}"" completed keep alive response.", EventName = "ConnectionKeepAlive")]
82[LoggerMessage(10, LogLevel.Debug, @"Connection id ""{ConnectionId}"" disconnecting.", EventName = "ConnectionDisconnect")]
85[LoggerMessage(16, LogLevel.Debug, "Some connections failed to close gracefully during server shutdown.", EventName = "NotAllConnectionsClosedGracefully")]
88[LoggerMessage(21, LogLevel.Debug, "Some connections failed to abort during server shutdown.", EventName = "NotAllConnectionsAborted")]
91[LoggerMessage(24, LogLevel.Warning, @"Connection id ""{ConnectionId}"" rejected because the maximum number of concurrent connections has been reached.", EventName = "ConnectionRejected")]
94[LoggerMessage(34, LogLevel.Information, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the application aborted the connection.", EventName = "ApplicationAbortedConnection")]
97[LoggerMessage(39, LogLevel.Debug, @"Connection id ""{ConnectionId}"" accepted.", EventName = "ConnectionAccepted")]
Internal\Infrastructure\KestrelTrace.General.cs (13)
79[LoggerMessage(13, LogLevel.Error, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": An unhandled exception was thrown by the application.", EventName = "ApplicationError")]
82[LoggerMessage(18, LogLevel.Debug, @"Connection id ""{ConnectionId}"" write of ""{count}"" body bytes to non-body HEAD response.", EventName = "ConnectionHeadResponseBodyWrite")]
85[LoggerMessage(22, LogLevel.Warning, @"As of ""{now}"", the heartbeat has been running for ""{heartbeatDuration}"" which is longer than ""{interval}"". This could be caused by thread pool starvation.", EventName = "HeartbeatSlow")]
88[LoggerMessage(23, LogLevel.Critical, @"Connection id ""{ConnectionId}"" application never completed.", EventName = "ApplicationNeverCompleted")]
91[LoggerMessage(25, LogLevel.Debug, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": started reading request body.", EventName = "RequestBodyStart", SkipEnabledCheck = true)]
94[LoggerMessage(26, LogLevel.Debug, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": done reading request body.", EventName = "RequestBodyDone", SkipEnabledCheck = true)]
97[LoggerMessage(32, LogLevel.Information, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": the application completed without reading the entire request body.", EventName = "RequestBodyNotEntirelyRead")]
100[LoggerMessage(33, LogLevel.Information, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": automatic draining of the request body timed out after taking over 5 seconds.", EventName = "RequestBodyDrainTimedOut")]
103[LoggerMessage(41, LogLevel.Warning, "One or more of the following response headers have been removed because they are invalid for HTTP/2 and HTTP/3 responses: 'Connection', 'Transfer-Encoding', 'Keep-Alive', 'Upgrade' and 'Proxy-Connection'.", EventName = "InvalidResponseHeaderRemoved")]
106[LoggerMessage(64, LogLevel.Warning, "HTTP/2 is not enabled for {Endpoint}. The endpoint is configured to use HTTP/1.1 and HTTP/2, but TLS is not enabled. HTTP/2 requires TLS application protocol negotiation. Connections to this endpoint will use HTTP/1.1.", EventName = "Http2DisabledWithHttp1AndNoTls")]
109[LoggerMessage(65, LogLevel.Warning, "HTTP/3 is not enabled for {Endpoint}. HTTP/3 requires TLS. Connections to this endpoint will use HTTP/1.1.", EventName = "Http3DisabledWithHttp1AndNoTls")]
112[LoggerMessage(66, LogLevel.Debug, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": The request was aborted by the client.", EventName = "RequestAborted")]
115[LoggerMessage(67, LogLevel.Error, @"Connection id ""{ConnectionId}"", Request id ""{TraceIdentifier}"": automatic draining of the request body failed because the body reader is in an invalid state.", EventName = "RequestBodyDrainBodyReaderInvalidState")]
Internal\Infrastructure\KestrelTrace.Http2.cs (19)
39if (_http2Logger.IsEnabled(LogLevel.Trace))
62if (_http2Logger.IsEnabled(LogLevel.Trace))
105[LoggerMessage(29, LogLevel.Debug, @"Connection id ""{ConnectionId}"": HTTP/2 connection error.", EventName = "Http2ConnectionError")]
108[LoggerMessage(30, LogLevel.Debug, @"Connection id ""{ConnectionId}"": HTTP/2 stream error.", EventName = "Http2StreamError")]
111[LoggerMessage(31, LogLevel.Debug, @"Connection id ""{ConnectionId}"": HPACK decoding error while decoding headers for stream ID {StreamId}.", EventName = "HPackDecodingError")]
114[LoggerMessage(35, LogLevel.Debug, @"Trace id ""{TraceIdentifier}"": HTTP/2 stream error ""{error}"". A Reset is being sent to the stream.", EventName = "Http2StreamResetAbort")]
117[LoggerMessage(36, LogLevel.Debug, @"Connection id ""{ConnectionId}"" is closing.", EventName = "Http2ConnectionClosing")]
120[LoggerMessage(37, LogLevel.Trace, @"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length} and flags {flags}.", EventName = "Http2FrameReceived", SkipEnabledCheck = true)]
123[LoggerMessage(38, LogLevel.Information, @"Connection id ""{ConnectionId}"": HPACK encoding error while encoding headers for stream ID {StreamId}.", EventName = "HPackEncodingError")]
126[LoggerMessage(40, LogLevel.Debug, @"Connection id ""{ConnectionId}"" reached the maximum number of concurrent HTTP/2 streams allowed.", EventName = "Http2MaxConcurrentStreamsReached")]
129[LoggerMessage(48, LogLevel.Debug, @"Connection id ""{ConnectionId}"" is closed. The last processed stream ID was {HighestOpenedStreamId}.", EventName = "Http2ConnectionClosed")]
132[LoggerMessage(49, LogLevel.Trace, @"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length} and flags {flags}.", EventName = "Http2FrameSending", SkipEnabledCheck = true)]
135[LoggerMessage(60, LogLevel.Critical, @"Connection id ""{ConnectionId}"" exceeded the output operations maximum queue size.", EventName = "Http2QueueOperationsExceeded")]
138[LoggerMessage(61, LogLevel.Critical, @"Stream {StreamId} on connection id ""{ConnectionId}"" observed an unexpected state where the streams output ended with data still remaining in the pipe.", EventName = "Http2UnexpectedDataRemaining")]
141[LoggerMessage(62, LogLevel.Debug, @"The connection queue processing loop for {ConnectionId} completed.", EventName = "Http2ConnectionQueueProcessingCompleted")]
144[LoggerMessage(63, LogLevel.Critical, @"The event loop in connection {ConnectionId} failed unexpectedly.", EventName = "Http2UnexpectedConnectionQueueError")]
149[LoggerMessage(64, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted since at least {Count} ENHANCE_YOUR_CALM responses were recorded per second.", EventName = "Http2TooManyEnhanceYourCalms")]
152[LoggerMessage(65, LogLevel.Debug, @"Connection id ""{ConnectionId}"" exceeded the output flow control maximum queue size of {Count}.", EventName = "Http2FlowControlQueueOperationsExceeded")]
155[LoggerMessage(66, LogLevel.Debug, @"Connection id ""{ConnectionId}"" configured maximum flow control queue size {Actual} is less than the maximum streams per connection {Expected}. Increasing configured value to {Expected}.", EventName = "Http2FlowControlQueueMaximumTooLow")]
Internal\Infrastructure\KestrelTrace.Http3.cs (13)
30if (_http3Logger.IsEnabled(LogLevel.Debug))
38if (_http3Logger.IsEnabled(LogLevel.Trace))
46if (_http3Logger.IsEnabled(LogLevel.Trace))
74[LoggerMessage(42, LogLevel.Debug, @"Connection id ""{ConnectionId}"": HTTP/3 connection error.", EventName = "Http3ConnectionError")]
77[LoggerMessage(43, LogLevel.Debug, @"Connection id ""{ConnectionId}"" is closing.", EventName = "Http3ConnectionClosing")]
80[LoggerMessage(44, LogLevel.Debug, @"Connection id ""{ConnectionId}"" is closed. The last processed stream ID was {HighestOpenedStreamId}.", EventName = "Http3ConnectionClosed")]
83[LoggerMessage(45, LogLevel.Debug, @"Trace id ""{TraceIdentifier}"": HTTP/3 stream error ""{error}"". An abort is being sent to the stream.", EventName = "Http3StreamAbort", SkipEnabledCheck = true)]
86[LoggerMessage(46, LogLevel.Trace, @"Connection id ""{ConnectionId}"" received {type} frame for stream ID {id} with length {length}.", EventName = "Http3FrameReceived", SkipEnabledCheck = true)]
89[LoggerMessage(47, LogLevel.Trace, @"Connection id ""{ConnectionId}"" sending {type} frame for stream ID {id} with length {length}.", EventName = "Http3FrameSending", SkipEnabledCheck = true)]
92[LoggerMessage(50, LogLevel.Debug, @"Connection id ""{ConnectionId}"": Unexpected error when initializing outbound control stream.", EventName = "Http3OutboundControlStreamError")]
95[LoggerMessage(51, LogLevel.Debug, @"Connection id ""{ConnectionId}"": QPACK decoding error while decoding headers for stream ID {StreamId}.", EventName = "QPackDecodingError")]
98[LoggerMessage(52, LogLevel.Information, @"Connection id ""{ConnectionId}"": QPACK encoding error while encoding headers for stream ID {StreamId}.", EventName = "QPackEncodingError")]
101[LoggerMessage(53, LogLevel.Debug, @"Connection id ""{ConnectionId}"": GOAWAY stream ID {GoAwayStreamId}.", EventName = "Http3GoAwayHighestOpenedStreamId")]
Internal\LoggerExtensions.cs (10)
15[LoggerMessage(0, LogLevel.Debug, "Using development certificate: {certificateSubjectName} (Thumbprint: {certificateThumbprint})", EventName = "LocatedDevelopmentCertificate")]
20[LoggerMessage(1, LogLevel.Debug, "Unable to locate an appropriate development https certificate.", EventName = "UnableToLocateDevelopmentCertificate")]
23[LoggerMessage(2, LogLevel.Debug, "Failed to locate the development https certificate at '{certificatePath}'.", EventName = "FailedToLocateDevelopmentCertificateFile")]
26[LoggerMessage(3, LogLevel.Debug, "Failed to load the development https certificate at '{certificatePath}'.", EventName = "FailedToLoadDevelopmentCertificate")]
29[LoggerMessage(4, LogLevel.Error, BadDeveloperCertificateStateMessage, EventName = "BadDeveloperCertificateState")]
32[LoggerMessage(5, LogLevel.Warning, "{Message}", EventName = "DeveloperCertificateFirstRun")]
35[LoggerMessage(6, LogLevel.Error, "The certificate file at '{CertificateFilePath}' can not be found, contains malformed data or does not contain a certificate.", EventName = "MissingOrInvalidCertificateFile")]
38[LoggerMessage(7, LogLevel.Error, "The certificate key file at '{CertificateKeyFilePath}' can not be found, contains malformed data or does not contain a PEM encoded key in PKCS8 format.", EventName = "MissingOrInvalidCertificateKeyFile")]
41[LoggerMessage(8, LogLevel.Warning, "The ASP.NET Core developer certificate is not trusted. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert", EventName = "DeveloperCertificateNotTrusted")]
44[LoggerMessage(9, LogLevel.Warning, "The ASP.NET Core developer certificate is only trusted by some clients. For information about trusting the ASP.NET Core developer certificate, see https://aka.ms/aspnet/https-trust-dev-cert", EventName = "DeveloperCertificatePartiallyTrusted")]
Middleware\HttpsConnectionMiddleware.cs (9)
583[LoggerMessage(1, LogLevel.Debug, "Failed to authenticate HTTPS connection.", EventName = "AuthenticationFailed")]
586[LoggerMessage(2, LogLevel.Debug, "Authentication of the HTTPS connection timed out.", EventName = "AuthenticationTimedOut")]
589[LoggerMessage(3, LogLevel.Debug, "Connection {ConnectionId} established using the following protocol: {Protocol}", EventName = "HttpsConnectionEstablished")]
592[LoggerMessage(4, LogLevel.Information, "HTTP/2 over TLS is not supported on Windows versions older than Windows 10 and Windows Server 2016 due to incompatible ciphers or missing ALPN support. Falling back to HTTP/1.1 instead.",
596[LoggerMessage(5, LogLevel.Debug, "Searching for certificate with private key and thumbprint {Thumbprint} in the certificate store.", EventName = "LocateCertWithPrivateKey")]
601[LoggerMessage(6, LogLevel.Debug, "Found certificate with private key and thumbprint {Thumbprint} in certificate store {StoreName}.", EventName = "FoundCertWithPrivateKey")]
610[LoggerMessage(7, LogLevel.Debug, "Failure to locate certificate from store.", EventName = "FailToLocateCertificate")]
613[LoggerMessage(8, LogLevel.Debug, "Failed to open certificate store {StoreName}.", EventName = "FailToOpenStore")]
616[LoggerMessage(9, LogLevel.Information, "Certificate with thumbprint {Thumbprint} lacks the subjectAlternativeName (SAN) extension and may not be accepted by browsers.", EventName = "NoSubjectAlternativeName")]
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (22)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (7)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (15)
Internal\NamedPipeLog.cs (15)
11[LoggerMessage(1, LogLevel.Debug, @"Connection id ""{ConnectionId}"" accepted.", EventName = "AcceptedConnection", SkipEnabledCheck = true)]
16if (logger.IsEnabled(LogLevel.Debug))
22[LoggerMessage(2, LogLevel.Debug, @"Connection id ""{ConnectionId}"" unexpected error.", EventName = "ConnectionError", SkipEnabledCheck = true)]
27if (logger.IsEnabled(LogLevel.Debug))
33[LoggerMessage(3, LogLevel.Error, "Named pipe listener aborted.", EventName = "ConnectionListenerAborted")]
36[LoggerMessage(4, LogLevel.Debug, @"Connection id ""{ConnectionId}"" paused.", EventName = "ConnectionPause", SkipEnabledCheck = true)]
41if (logger.IsEnabled(LogLevel.Debug))
47[LoggerMessage(5, LogLevel.Debug, @"Connection id ""{ConnectionId}"" resumed.", EventName = "ConnectionResume", SkipEnabledCheck = true)]
52if (logger.IsEnabled(LogLevel.Debug))
58[LoggerMessage(6, LogLevel.Debug, @"Connection id ""{ConnectionId}"" received end of stream.", EventName = "ConnectionReadEnd", SkipEnabledCheck = true)]
63if (logger.IsEnabled(LogLevel.Debug))
69[LoggerMessage(7, LogLevel.Debug, @"Connection id ""{ConnectionId}"" disconnecting stream because: ""{Reason}""", EventName = "ConnectionDisconnect", SkipEnabledCheck = true)]
74if (logger.IsEnabled(LogLevel.Debug))
80[LoggerMessage(8, LogLevel.Debug, "Named pipe listener received broken pipe while waiting for a connection.", EventName = "ConnectionListenerBrokenPipe")]
83[LoggerMessage(9, LogLevel.Trace, "Named pipe listener queue exited.", EventName = "ConnectionListenerQueueExited")]
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (43)
Internal\QuicLog.cs (43)
13[LoggerMessage(1, LogLevel.Debug, @"Connection id ""{ConnectionId}"" accepted.", EventName = "AcceptedConnection", SkipEnabledCheck = true)]
18if (logger.IsEnabled(LogLevel.Debug))
24[LoggerMessage(2, LogLevel.Debug, @"Stream id ""{ConnectionId}"" type {StreamType} accepted.", EventName = "AcceptedStream", SkipEnabledCheck = true)]
29if (logger.IsEnabled(LogLevel.Debug))
35[LoggerMessage(3, LogLevel.Debug, @"Stream id ""{ConnectionId}"" type {StreamType} connected.", EventName = "ConnectedStream", SkipEnabledCheck = true)]
40if (logger.IsEnabled(LogLevel.Debug))
46[LoggerMessage(4, LogLevel.Debug, @"Connection id ""{ConnectionId}"" unexpected error.", EventName = "ConnectionError", SkipEnabledCheck = true)]
51if (logger.IsEnabled(LogLevel.Debug))
57[LoggerMessage(5, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted by peer with error code {ErrorCode}.", EventName = "ConnectionAborted", SkipEnabledCheck = true)]
62if (logger.IsEnabled(LogLevel.Debug))
68[LoggerMessage(6, LogLevel.Debug, @"Connection id ""{ConnectionId}"" aborted by application with error code {ErrorCode} because: ""{Reason}"".", EventName = "ConnectionAbort", SkipEnabledCheck = true)]
73if (logger.IsEnabled(LogLevel.Debug))
79[LoggerMessage(7, LogLevel.Debug, @"Stream id ""{ConnectionId}"" unexpected error.", EventName = "StreamError", SkipEnabledCheck = true)]
84if (logger.IsEnabled(LogLevel.Debug))
90[LoggerMessage(8, LogLevel.Debug, @"Stream id ""{ConnectionId}"" paused.", EventName = "StreamPause", SkipEnabledCheck = true)]
95if (logger.IsEnabled(LogLevel.Debug))
101[LoggerMessage(9, LogLevel.Debug, @"Stream id ""{ConnectionId}"" resumed.", EventName = "StreamResume", SkipEnabledCheck = true)]
106if (logger.IsEnabled(LogLevel.Debug))
112[LoggerMessage(10, LogLevel.Debug, @"Stream id ""{ConnectionId}"" shutting down writes because: ""{Reason}"".", EventName = "StreamShutdownWrite", SkipEnabledCheck = true)]
117if (logger.IsEnabled(LogLevel.Debug))
123[LoggerMessage(11, LogLevel.Debug, @"Stream id ""{ConnectionId}"" read aborted by peer with error code {ErrorCode}.", EventName = "StreamAbortedRead", SkipEnabledCheck = true)]
128if (logger.IsEnabled(LogLevel.Debug))
134[LoggerMessage(12, LogLevel.Debug, @"Stream id ""{ConnectionId}"" write aborted by peer with error code {ErrorCode}.", EventName = "StreamAbortedWrite", SkipEnabledCheck = true)]
139if (logger.IsEnabled(LogLevel.Debug))
145[LoggerMessage(13, LogLevel.Debug, @"Stream id ""{ConnectionId}"" aborted by application with error code {ErrorCode} because: ""{Reason}"".", EventName = "StreamAbort", SkipEnabledCheck = true)]
150if (logger.IsEnabled(LogLevel.Debug))
156[LoggerMessage(14, LogLevel.Debug, @"Stream id ""{ConnectionId}"" read side aborted by application with error code {ErrorCode} because: ""{Reason}"".", EventName = "StreamAbortRead", SkipEnabledCheck = true)]
161if (logger.IsEnabled(LogLevel.Debug))
167[LoggerMessage(15, LogLevel.Debug, @"Stream id ""{ConnectionId}"" write side aborted by application with error code {ErrorCode} because: ""{Reason}"".", EventName = "StreamAbortWrite", SkipEnabledCheck = true)]
172if (logger.IsEnabled(LogLevel.Debug))
178[LoggerMessage(16, LogLevel.Trace, @"Stream id ""{ConnectionId}"" pooled for reuse.", EventName = "StreamPooled", SkipEnabledCheck = true)]
183if (logger.IsEnabled(LogLevel.Trace))
189[LoggerMessage(17, LogLevel.Trace, @"Stream id ""{ConnectionId}"" reused from pool.", EventName = "StreamReused", SkipEnabledCheck = true)]
194if (logger.IsEnabled(LogLevel.Trace))
200[LoggerMessage(18, LogLevel.Warning, $"{nameof(SslServerAuthenticationOptions)} must provide a server certificate using {nameof(SslServerAuthenticationOptions.ServerCertificate)}," +
204[LoggerMessage(19, LogLevel.Warning, $"{nameof(SslServerAuthenticationOptions)} must provide at least one application protocol using {nameof(SslServerAuthenticationOptions.ApplicationProtocols)}.", EventName = "ConnectionListenerApplicationProtocolsNotSpecified")]
207[LoggerMessage(20, LogLevel.Debug, "QUIC listener starting with configured endpoint {listenEndPoint}.", EventName = "ConnectionListenerStarting")]
210[LoggerMessage(21, LogLevel.Debug, "QUIC listener aborted.", EventName = "ConnectionListenerAborted")]
213[LoggerMessage(22, LogLevel.Debug, @"Stream id ""{ConnectionId}"" read timed out.", EventName = "StreamTimeoutRead", SkipEnabledCheck = true)]
218if (logger.IsEnabled(LogLevel.Debug))
224[LoggerMessage(23, LogLevel.Debug, @"Stream id ""{ConnectionId}"" write timed out.", EventName = "StreamTimeoutWrite", SkipEnabledCheck = true)]
229if (logger.IsEnabled(LogLevel.Debug))
235[LoggerMessage(24, LogLevel.Debug, "QUIC listener connection failed.", EventName = "ConnectionListenerAcceptConnectionFailed")]
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (14)
Internal\SocketsLog.cs (14)
12[LoggerMessage(6, LogLevel.Debug, @"Connection id ""{ConnectionId}"" received FIN.", EventName = "ConnectionReadFin", SkipEnabledCheck = true)]
17if (logger.IsEnabled(LogLevel.Debug))
23[LoggerMessage(7, LogLevel.Debug, @"Connection id ""{ConnectionId}"" sending FIN because: ""{Reason}""", EventName = "ConnectionWriteFin", SkipEnabledCheck = true)]
28if (logger.IsEnabled(LogLevel.Debug))
34[LoggerMessage(8, LogLevel.Debug, @"Connection id ""{ConnectionId}"" sending RST because: ""{Reason}""", EventName = "ConnectionWriteRst", SkipEnabledCheck = true)]
39if (logger.IsEnabled(LogLevel.Debug))
49[LoggerMessage(14, LogLevel.Debug, @"Connection id ""{ConnectionId}"" communication error.", EventName = "ConnectionError", SkipEnabledCheck = true)]
54if (logger.IsEnabled(LogLevel.Debug))
60[LoggerMessage(19, LogLevel.Debug, @"Connection id ""{ConnectionId}"" reset.", EventName = "ConnectionReset", SkipEnabledCheck = true)]
65if (logger.IsEnabled(LogLevel.Debug))
71[LoggerMessage(4, LogLevel.Debug, @"Connection id ""{ConnectionId}"" paused.", EventName = "ConnectionPause", SkipEnabledCheck = true)]
76if (logger.IsEnabled(LogLevel.Debug))
82[LoggerMessage(5, LogLevel.Debug, @"Connection id ""{ConnectionId}"" resumed.", EventName = "ConnectionResume", SkipEnabledCheck = true)]
87if (logger.IsEnabled(LogLevel.Debug))
Microsoft.AspNetCore.Session (15)
LoggingExtensions.cs (13)
8[LoggerMessage(1, LogLevel.Error, "Error closing the session.", EventName = "ErrorClosingTheSession")]
11[LoggerMessage(2, LogLevel.Information, "Accessing expired session, Key:{sessionKey}", EventName = "AccessingExpiredSession")]
14[LoggerMessage(3, LogLevel.Information, "Session started; Key:{sessionKey}, Id:{sessionId}", EventName = "SessionStarted", SkipEnabledCheck = true)]
17[LoggerMessage(4, LogLevel.Debug, "Session loaded; Key:{sessionKey}, Id:{sessionId}, Count:{count}", EventName = "SessionLoaded", SkipEnabledCheck = true)]
20[LoggerMessage(5, LogLevel.Debug, "Session stored; Key:{sessionKey}, Id:{sessionId}, Count:{count}", EventName = "SessionStored")]
23[LoggerMessage(6, LogLevel.Error, "Session cache read exception, Key:{sessionKey}", EventName = "SessionCacheReadException", SkipEnabledCheck = true)]
26[LoggerMessage(7, LogLevel.Warning, "Error unprotecting the session cookie.", EventName = "ErrorUnprotectingCookie")]
29[LoggerMessage(8, LogLevel.Warning, "Loading the session timed out.", EventName = "SessionLoadingTimeout")]
32[LoggerMessage(9, LogLevel.Warning, "Committing the session timed out.", EventName = "SessionCommitTimeout")]
35[LoggerMessage(10, LogLevel.Information, "Committing the session was canceled.", EventName = "SessionCommitCanceled")]
38[LoggerMessage(11, LogLevel.Warning, "Refreshing the session timed out.", EventName = "SessionRefreshTimeout")]
41[LoggerMessage(12, LogLevel.Information, "Refreshing the session was canceled.", EventName = "SessionRefreshCanceled")]
44[LoggerMessage(13, LogLevel.Information, "Session cannot be committed since it is unavailable.", EventName = "SessionCommitNotAvailable")]
Microsoft.AspNetCore.Session.Tests (18)
SessionTests.cs (18)
370Assert.Equal(LogLevel.Information, sessionLogMessages[0].LogLevel);
372Assert.Equal(LogLevel.Debug, sessionLogMessages[1].LogLevel);
438Assert.Equal(LogLevel.Information, sessionLogMessages[0].LogLevel);
439Assert.Equal(LogLevel.Debug, sessionLogMessages[1].LogLevel);
440Assert.Equal(LogLevel.Information, sessionLogMessages[2].LogLevel);
684Assert.Equal(LogLevel.Error, message.LogLevel);
733Assert.Equal(LogLevel.Error, message.LogLevel);
781Assert.Equal(LogLevel.Warning, message.LogLevel);
882Assert.Equal(LogLevel.Information, sessionLogMessage.LogLevel);
887Assert.Equal(LogLevel.Error, sessionMiddlewareLogMessage.LogLevel);
945Assert.Equal(LogLevel.Information, sessionLogMessages[0].LogLevel);
948Assert.Equal(LogLevel.Warning, sessionLogMessages[1].LogLevel);
953Assert.Equal(LogLevel.Information, sessionMiddlewareLogs[0].LogLevel);
1012Assert.Equal(LogLevel.Information, sessionLogMessages[0].LogLevel);
1015Assert.Equal(LogLevel.Debug, sessionLogMessages[1].LogLevel);
1076Assert.Equal(LogLevel.Information, sessionLogMessages[0].LogLevel);
1079Assert.Equal(LogLevel.Debug, sessionLogMessages[1].LogLevel);
1127Assert.Equal(LogLevel.Error, message.LogLevel);
Microsoft.AspNetCore.SignalR.Client.Core (102)
HubConnection.Log.cs (94)
15[LoggerMessage(1, LogLevel.Trace, "Preparing non-blocking invocation of '{Target}', with {ArgumentCount} argument(s).", EventName = "PreparingNonBlockingInvocation")]
18[LoggerMessage(2, LogLevel.Trace, "Preparing blocking invocation '{InvocationId}' of '{Target}', with return type '{ReturnType}' and {ArgumentCount} argument(s).", EventName = "PreparingBlockingInvocation")]
21[LoggerMessage(3, LogLevel.Debug, "Registering Invocation ID '{InvocationId}' for tracking.", EventName = "RegisteringInvocation")]
24[LoggerMessage(4, LogLevel.Trace, "Issuing Invocation '{InvocationId}': {ReturnType} {MethodName}({Args}).", EventName = "IssuingInvocation", SkipEnabledCheck = true)]
29if (logger.IsEnabled(LogLevel.Trace))
38if (logger.IsEnabled(LogLevel.Debug))
51[LoggerMessage(5, LogLevel.Debug, "Sending {MessageType} message '{InvocationId}'.", EventName = "SendingMessage", SkipEnabledCheck = true)]
54[LoggerMessage(59, LogLevel.Debug, "Sending {MessageType} message.", EventName = "SendingMessageGeneric", SkipEnabledCheck = true)]
59if (logger.IsEnabled(LogLevel.Debug))
72[LoggerMessage(6, LogLevel.Debug, "Sending {MessageType} message '{InvocationId}' completed.", EventName = "MessageSent", SkipEnabledCheck = true)]
75[LoggerMessage(60, LogLevel.Debug, "Sending {MessageType} message completed.", EventName = "MessageSentGeneric", SkipEnabledCheck = true)]
78[LoggerMessage(7, LogLevel.Error, "Sending Invocation '{InvocationId}' failed.", EventName = "FailedToSendInvocation")]
81[LoggerMessage(8, LogLevel.Trace, "Received Invocation '{InvocationId}': {MethodName}({Args}).", EventName = "ReceivedInvocation", SkipEnabledCheck = true)]
86if (logger.IsEnabled(LogLevel.Trace))
93[LoggerMessage(9, LogLevel.Warning, "Dropped unsolicited Completion message for invocation '{InvocationId}'.", EventName = "DroppedCompletionMessage")]
96[LoggerMessage(10, LogLevel.Warning, "Dropped unsolicited StreamItem message for invocation '{InvocationId}'.", EventName = "DroppedStreamMessage")]
99[LoggerMessage(11, LogLevel.Trace, "Shutting down connection.", EventName = "ShutdownConnection")]
102[LoggerMessage(12, LogLevel.Error, "Connection is shutting down due to an error.", EventName = "ShutdownWithError")]
105[LoggerMessage(13, LogLevel.Trace, "Removing pending invocation {InvocationId}.", EventName = "RemovingInvocation")]
108[LoggerMessage(14, LogLevel.Warning, "Failed to find handler for '{Target}' method.", EventName = "MissingHandler")]
111[LoggerMessage(15, LogLevel.Trace, "Received StreamItem for Invocation {InvocationId}.", EventName = "ReceivedStreamItem")]
114[LoggerMessage(16, LogLevel.Trace, "Canceling dispatch of StreamItem message for Invocation {InvocationId}. The invocation was canceled.", EventName = "CancelingStreamItem")]
117[LoggerMessage(17, LogLevel.Warning, "Invocation {InvocationId} received stream item after channel was closed.", EventName = "ReceivedStreamItemAfterClose")]
120[LoggerMessage(18, LogLevel.Trace, "Received Completion for Invocation {InvocationId}.", EventName = "ReceivedInvocationCompletion")]
123[LoggerMessage(19, LogLevel.Trace, "Canceling dispatch of Completion message for Invocation {InvocationId}. The invocation was canceled.", EventName = "CancelingInvocationCompletion")]
126[LoggerMessage(21, LogLevel.Debug, "HubConnection stopped.", EventName = "Stopped")]
129[LoggerMessage(22, LogLevel.Critical, "Invocation ID '{InvocationId}' is already in use.", EventName = "InvocationAlreadyInUse")]
132[LoggerMessage(23, LogLevel.Error, "Unsolicited response received for invocation '{InvocationId}'.", EventName = "ReceivedUnexpectedResponse")]
135[LoggerMessage(24, LogLevel.Information, "Using HubProtocol '{Protocol} v{Version}'.", EventName = "HubProtocol")]
138[LoggerMessage(25, LogLevel.Trace, "Preparing streaming invocation '{InvocationId}' of '{Target}', with return type '{ReturnType}' and {ArgumentCount} argument(s).", EventName = "PreparingStreamingInvocation")]
141[LoggerMessage(26, LogLevel.Trace, "Resetting keep-alive timer, received a message from the server.", EventName = "ResettingKeepAliveTimer")]
144[LoggerMessage(27, LogLevel.Error, "An exception was thrown in the handler for the Closed event.", EventName = "ErrorDuringClosedEvent")]
147[LoggerMessage(28, LogLevel.Debug, "Sending Hub Handshake.", EventName = "SendingHubHandshake")]
150[LoggerMessage(31, LogLevel.Trace, "Received a ping message.", EventName = "ReceivedPing")]
153[LoggerMessage(34, LogLevel.Error, "Invoking client side method '{MethodName}' failed.", EventName = "ErrorInvokingClientSideMethod")]
156[LoggerMessage(35, LogLevel.Error, "The underlying connection closed while processing the handshake response. See exception for details.", EventName = "ErrorReceivingHandshakeResponse")]
159[LoggerMessage(36, LogLevel.Error, "Server returned handshake error: {Error}", EventName = "HandshakeServerError")]
162[LoggerMessage(37, LogLevel.Debug, "Received close message.", EventName = "ReceivedClose")]
165[LoggerMessage(38, LogLevel.Error, "Received close message with an error: {Error}", EventName = "ReceivedCloseWithError")]
168[LoggerMessage(39, LogLevel.Debug, "Handshake with server complete.", EventName = "HandshakeComplete")]
171[LoggerMessage(40, LogLevel.Debug, "Registering handler for client method '{MethodName}'.", EventName = "RegisteringHandler")]
174[LoggerMessage(58, LogLevel.Debug, "Removing handlers for client method '{MethodName}'.", EventName = "RemovingHandlers")]
177[LoggerMessage(41, LogLevel.Debug, "Starting HubConnection.", EventName = "Starting")]
180[LoggerMessage(43, LogLevel.Error, "Error starting connection.", EventName = "ErrorStartingConnection")]
183[LoggerMessage(44, LogLevel.Information, "HubConnection started.", EventName = "Started")]
186[LoggerMessage(45, LogLevel.Debug, "Sending Cancellation for Invocation '{InvocationId}'.", EventName = "SendingCancellation")]
189[LoggerMessage(46, LogLevel.Debug, "Canceling all outstanding invocations.", EventName = "CancelingOutstandingInvocations")]
192[LoggerMessage(47, LogLevel.Debug, "Receive loop starting.", EventName = "ReceiveLoopStarting")]
195[LoggerMessage(48, LogLevel.Debug, "Starting server timeout timer. Duration: {ServerTimeout:0.00}ms", EventName = "StartingServerTimeoutTimer", SkipEnabledCheck = true)]
200if (logger.IsEnabled(LogLevel.Debug))
206[LoggerMessage(49, LogLevel.Debug, "Not using server timeout because the transport inherently tracks server availability.", EventName = "NotUsingServerTimeout")]
209[LoggerMessage(50, LogLevel.Error, "The server connection was terminated with an error.", EventName = "ServerDisconnectedWithError")]
212[LoggerMessage(51, LogLevel.Debug, "Invoking the Closed event handler.", EventName = "InvokingClosedEventHandler")]
215[LoggerMessage(52, LogLevel.Debug, "Stopping HubConnection.", EventName = "Stopping")]
218[LoggerMessage(53, LogLevel.Debug, "Terminating receive loop.", EventName = "TerminatingReceiveLoop")]
221[LoggerMessage(54, LogLevel.Debug, "Waiting for the receive loop to terminate.", EventName = "WaitingForReceiveLoopToTerminate")]
224[LoggerMessage(56, LogLevel.Debug, "Processing {MessageLength} byte message from server.", EventName = "ProcessingMessage")]
227[LoggerMessage(42, LogLevel.Trace, "Waiting on Connection Lock in {MethodName} ({FilePath}:{LineNumber}).", EventName = "WaitingOnConnectionLock")]
230[LoggerMessage(20, LogLevel.Trace, "Releasing Connection Lock in {MethodName} ({FilePath}:{LineNumber}).", EventName = "ReleasingConnectionLock")]
233[LoggerMessage(55, LogLevel.Trace, "Unable to send cancellation for invocation '{InvocationId}'. The connection is inactive.", EventName = "UnableToSendCancellation")]
236[LoggerMessage(57, LogLevel.Error, "Failed to bind arguments received in invocation '{InvocationId}' of '{MethodName}'.", EventName = "ArgumentBindingFailure")]
239[LoggerMessage(61, LogLevel.Trace, "Acquired the Connection Lock in order to ping the server.", EventName = "AcquiredConnectionLockForPing")]
242[LoggerMessage(62, LogLevel.Trace, "Skipping ping because a send is already in progress.", EventName = "UnableToAcquireConnectionLockForPing")]
245[LoggerMessage(63, LogLevel.Trace, "Initiating stream '{StreamId}'.", EventName = "StartingStream")]
248[LoggerMessage(64, LogLevel.Trace, "Sending item for stream '{StreamId}'.", EventName = "StreamItemSent")]
251[LoggerMessage(65, LogLevel.Trace, "Stream '{StreamId}' has been canceled by client.", EventName = "CancelingStream")]
254[LoggerMessage(66, LogLevel.Trace, "Sending completion message for stream '{StreamId}'.", EventName = "CompletingStream")]
257[LoggerMessage(67, LogLevel.Error, "The HubConnection failed to transition from the {ExpectedState} state to the {NewState} state because it was actually in the {ActualState} state.", EventName = "StateTransitionFailed")]
260[LoggerMessage(68, LogLevel.Information, "HubConnection reconnecting.", EventName = "Reconnecting")]
263[LoggerMessage(69, LogLevel.Error, "HubConnection reconnecting due to an error.", EventName = "ReconnectingWithError")]
266[LoggerMessage(70, LogLevel.Information, "HubConnection reconnected successfully after {ReconnectAttempts} attempts and {ElapsedTime} elapsed.", EventName = "Reconnected")]
269[LoggerMessage(71, LogLevel.Information, "Reconnect retries have been exhausted after {ReconnectAttempts} failed attempts and {ElapsedTime} elapsed. Disconnecting.", EventName = "ReconnectAttemptsExhausted")]
272[LoggerMessage(72, LogLevel.Trace, "Reconnect attempt number {ReconnectAttempts} will start in {RetryDelay}.", EventName = "AwaitingReconnectRetryDelay")]
275[LoggerMessage(73, LogLevel.Trace, "Reconnect attempt failed.", EventName = "ReconnectAttemptFailed")]
278[LoggerMessage(74, LogLevel.Error, "An exception was thrown in the handler for the Reconnecting event.", EventName = "ErrorDuringReconnectingEvent")]
281[LoggerMessage(75, LogLevel.Error, "An exception was thrown in the handler for the Reconnected event.", EventName = "ErrorDuringReconnectedEvent")]
284[LoggerMessage(76, LogLevel.Error, $"An exception was thrown from {nameof(IRetryPolicy)}.{nameof(IRetryPolicy.NextRetryDelay)}().", EventName = "ErrorDuringNextRetryDelay")]
287[LoggerMessage(77, LogLevel.Warning, "Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.", EventName = "FirstReconnectRetryDelayNull")]
290[LoggerMessage(78, LogLevel.Trace, "Connection stopped during reconnect delay. Done reconnecting.", EventName = "ReconnectingStoppedDueToStateChangeDuringRetryDelay")]
293[LoggerMessage(79, LogLevel.Trace, "Connection stopped during reconnect attempt. Done reconnecting.", EventName = "ReconnectingStoppedDueToStateChangeDuringReconnectAttempt")]
296[LoggerMessage(80, LogLevel.Trace, "The HubConnection is attempting to transition from the {ExpectedState} state to the {NewState} state.", EventName = "AttemptingStateTransition")]
299[LoggerMessage(81, LogLevel.Error, "Received an invalid handshake response.", EventName = "ErrorInvalidHandshakeResponse")]
305[LoggerMessage(82, LogLevel.Error, "The handshake timed out after {HandshakeTimeoutSeconds} seconds.", EventName = "ErrorHandshakeTimedOut")]
308[LoggerMessage(83, LogLevel.Error, "The handshake was canceled by the client.", EventName = "ErrorHandshakeCanceled")]
311[LoggerMessage(84, LogLevel.Trace, "Client threw an error for stream '{StreamId}'.", EventName = "ErroredStream")]
314[LoggerMessage(85, LogLevel.Warning, "Failed to find a value returning handler for '{Target}' method. Sending error to server.", EventName = "MissingResultHandler")]
317[LoggerMessage(86, LogLevel.Warning, "Result given for '{Target}' method but server is not expecting a result.", EventName = "ResultNotExpected")]
320[LoggerMessage(87, LogLevel.Trace, "Completion message for stream '{StreamId}' was not sent because the connection is closed.", EventName = "CompletingStreamNotSent")]
323[LoggerMessage(88, LogLevel.Warning, "Error returning result for invocation '{InvocationId}' for method '{Target}' because the underlying connection is closed.", EventName = "ErrorSendingInvocationResult")]
326[LoggerMessage(89, LogLevel.Trace, "Error sending Completion message for stream '{StreamId}'.", EventName = "ErrorSendingStreamCompletion")]
329[LoggerMessage(90, LogLevel.Trace, "Dropping {MessageType} with ID '{InvocationId}'.", EventName = "DroppingMessage")]
332[LoggerMessage(91, LogLevel.Trace, "Received AckMessage with Sequence ID '{SequenceId}'.", EventName = "ReceivedAckMessage")]
335[LoggerMessage(92, LogLevel.Trace, "Received SequenceMessage with Sequence ID '{SequenceId}'.", EventName = "ReceivedSequenceMessage")]
338[LoggerMessage(93, LogLevel.Debug, "HubProtocol '{Protocol} v{Version}' does not support Stateful Reconnect. Disabling the feature.", EventName = "DisablingReconnect")]
Internal\InvocationRequest.cs (7)
236[LoggerMessage(1, LogLevel.Trace, "Invocation {InvocationId} created.", EventName = "InvocationCreated")]
239[LoggerMessage(2, LogLevel.Trace, "Invocation {InvocationId} disposed.", EventName = "InvocationDisposed")]
242[LoggerMessage(3, LogLevel.Trace, "Invocation {InvocationId} marked as completed.", EventName = "InvocationCompleted")]
245[LoggerMessage(4, LogLevel.Trace, "Invocation {InvocationId} marked as failed.", EventName = "InvocationFailed")]
250[LoggerMessage(5, LogLevel.Error, "Invocation {InvocationId} caused an error trying to write a stream item.", EventName = "ErrorWritingStreamItem")]
253[LoggerMessage(6, LogLevel.Error, "Invocation {InvocationId} received a completion result, but was invoked as a streaming invocation.", EventName = "ReceivedUnexpectedComplete")]
258[LoggerMessage(7, LogLevel.Error, "Invocation {InvocationId} received stream item but was invoked as a non-streamed invocation.", EventName = "StreamItemOnNonStreamInvocation")]
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (23)
Microsoft.AspNetCore.SignalR.Client.Tests (13)
Microsoft.AspNetCore.SignalR.Core (48)
HubConnectionContext.Log.cs (11)
12[LoggerMessage(1, LogLevel.Debug, "Completed connection handshake. Using HubProtocol '{Protocol}'.", EventName = "HandshakeComplete")]
15[LoggerMessage(2, LogLevel.Debug, "Handshake was canceled.", EventName = "HandshakeCanceled")]
18[LoggerMessage(3, LogLevel.Trace, "Sent a ping message to the client.", EventName = "SentPing")]
21[LoggerMessage(4, LogLevel.Debug, "Unable to send Ping message to client, the transport buffer is full.", EventName = "TransportBufferFull")]
24[LoggerMessage(5, LogLevel.Debug, "Failed connection handshake.", EventName = "HandshakeFailed")]
27[LoggerMessage(6, LogLevel.Error, "Failed writing message. Aborting connection.", EventName = "FailedWritingMessage")]
30[LoggerMessage(7, LogLevel.Debug, "Server does not support version {Version} of the {Protocol} protocol.", EventName = "ProtocolVersionFailed")]
33[LoggerMessage(8, LogLevel.Trace, "Abort callback failed.", EventName = "AbortFailed")]
36[LoggerMessage(9, LogLevel.Debug, "Client timeout ({ClientTimeout}ms) elapsed without receiving a message from the client. Closing connection.", EventName = "ClientTimeout")]
39[LoggerMessage(10, LogLevel.Debug, "The maximum message size of {MaxMessageSize}B was exceeded while parsing the Handshake. The message size can be configured in AddHubOptions.", EventName = "HandshakeSizeLimitExceeded")]
42[LoggerMessage(11, LogLevel.Debug, "HubProtocol '{Protocol} v{Version}' does not support Stateful Reconnect. Disabling the feature.", EventName = "DisablingReconnect")]
HubConnectionHandlerLog.cs (6)
10[LoggerMessage(1, LogLevel.Error, "Error when dispatching '{HubMethod}' on hub.", EventName = "ErrorDispatchingHubEvent")]
13[LoggerMessage(2, LogLevel.Debug, "Error when processing requests.", EventName = "ErrorProcessingRequest")]
16[LoggerMessage(3, LogLevel.Trace, "Abort callback failed.", EventName = "AbortFailed")]
19[LoggerMessage(4, LogLevel.Debug, "Error when sending Close message.", EventName = "ErrorSendingClose")]
22[LoggerMessage(5, LogLevel.Debug, "OnConnectedAsync started.", EventName = "ConnectedStarting")]
25[LoggerMessage(6, LogLevel.Debug, "OnConnectedAsync ending.", EventName = "ConnectedEnding")]
Internal\DefaultHubDispatcherLog.cs (28)
12[LoggerMessage(1, LogLevel.Debug, "Received hub invocation: {InvocationMessage}.", EventName = "ReceivedHubInvocation")]
15[LoggerMessage(2, LogLevel.Debug, "Received unsupported message of type '{MessageType}'.", EventName = "UnsupportedMessageReceived")]
18[LoggerMessage(3, LogLevel.Debug, "Unknown hub method '{HubMethod}'.", EventName = "UnknownHubMethod")]
23[LoggerMessage(5, LogLevel.Debug, "Failed to invoke '{HubMethod}' because user is unauthorized.", EventName = "HubMethodNotAuthorized")]
28if (logger.IsEnabled(LogLevel.Trace))
35[LoggerMessage(6, LogLevel.Trace, "InvocationId {InvocationId}: Streaming result of type '{ResultType}'.", EventName = "StreamingResult", SkipEnabledCheck = true)]
40if (logger.IsEnabled(LogLevel.Trace))
47[LoggerMessage(7, LogLevel.Trace, "InvocationId {InvocationId}: Sending result of type '{ResultType}'.", EventName = "SendingResult", SkipEnabledCheck = true)]
50[LoggerMessage(8, LogLevel.Error, "Failed to invoke hub method '{HubMethod}'.", EventName = "FailedInvokingHubMethod")]
53[LoggerMessage(9, LogLevel.Trace, "'{HubName}' hub method '{HubMethod}' is bound.", EventName = "HubMethodBound")]
56[LoggerMessage(10, LogLevel.Debug, "Canceling stream for invocation {InvocationId}.", EventName = "CancelStream")]
59[LoggerMessage(11, LogLevel.Debug, "CancelInvocationMessage received unexpectedly.", EventName = "UnexpectedCancel")]
62[LoggerMessage(12, LogLevel.Debug, "Received stream hub invocation: {InvocationMessage}.", EventName = "ReceivedStreamHubInvocation")]
65[LoggerMessage(13, LogLevel.Debug, "A streaming method was invoked with a non-streaming invocation : {InvocationMessage}.", EventName = "StreamingMethodCalledWithInvoke")]
68[LoggerMessage(14, LogLevel.Debug, "A non-streaming method was invoked with a streaming invocation : {InvocationMessage}.", EventName = "NonStreamingMethodCalledWithStream")]
71[LoggerMessage(15, LogLevel.Debug, "A streaming method returned a value that cannot be used to build enumerator {HubMethod}.", EventName = "InvalidReturnValueFromStreamingMethod")]
77[LoggerMessage(16, LogLevel.Trace, "Received item for stream '{StreamId}'.", EventName = "ReceivedStreamItem")]
80[LoggerMessage(17, LogLevel.Trace, "Creating streaming parameter channel '{StreamId}'.", EventName = "StartingParameterStream")]
86[LoggerMessage(18, LogLevel.Trace, "Stream '{StreamId}' has been completed by client.", EventName = "CompletingStream")]
92[LoggerMessage(19, LogLevel.Debug, "Stream '{StreamId}' closed with error '{Error}'.", EventName = "ClosingStreamWithBindingError")]
97[LoggerMessage(21, LogLevel.Debug, "StreamItemMessage received unexpectedly.", EventName = "UnexpectedStreamItem")]
100[LoggerMessage(22, LogLevel.Debug, "Parameters to hub method '{HubMethod}' are incorrect.", EventName = "InvalidHubParameters")]
103[LoggerMessage(23, LogLevel.Debug, "Invocation ID '{InvocationId}' is already in use.", EventName = "InvocationIdInUse")]
106[LoggerMessage(24, LogLevel.Debug, "CompletionMessage for invocation ID '{InvocationId}' received unexpectedly.", EventName = "UnexpectedCompletion")]
109[LoggerMessage(25, LogLevel.Error, "Invocation ID {InvocationId}: Failed while sending stream items from hub method {HubMethod}.", EventName = "FailedStreaming")]
112[LoggerMessage(26, LogLevel.Trace, "Dropping {MessageType} with ID '{InvocationId}'.", EventName = "DroppingMessage")]
115[LoggerMessage(27, LogLevel.Trace, "Received AckMessage with Sequence ID '{SequenceId}'.", EventName = "ReceivedAckMessage")]
118[LoggerMessage(28, LogLevel.Trace, "Received SequenceMessage with Sequence ID '{SequenceId}'.", EventName = "ReceivedSequenceMessage")]
Microsoft.AspNetCore.SignalR.StackExchangeRedis (17)
Internal\RedisLog.cs (17)
16if (logger.IsEnabled(LogLevel.Information) && endpoints.Count > 0)
22[LoggerMessage(1, LogLevel.Information, "Connecting to Redis endpoints: {Endpoints}. Using Server Name: {ServerName}", EventName = "ConnectingToEndpoints")]
25[LoggerMessage(2, LogLevel.Information, "Connected to Redis.", EventName = "Connected")]
28[LoggerMessage(3, LogLevel.Trace, "Subscribing to channel: {Channel}.", EventName = "Subscribing")]
31[LoggerMessage(4, LogLevel.Trace, "Received message from Redis channel {Channel}.", EventName = "ReceivedFromChannel")]
34[LoggerMessage(5, LogLevel.Trace, "Publishing message to Redis channel {Channel}.", EventName = "PublishToChannel")]
37[LoggerMessage(6, LogLevel.Trace, "Unsubscribing from channel: {Channel}.", EventName = "Unsubscribe")]
40[LoggerMessage(7, LogLevel.Error, "Not connected to Redis.", EventName = "NotConnected")]
43[LoggerMessage(8, LogLevel.Information, "Connection to Redis restored.", EventName = "ConnectionRestored")]
46[LoggerMessage(9, LogLevel.Error, "Connection to Redis failed.", EventName = "ConnectionFailed")]
49[LoggerMessage(10, LogLevel.Debug, "Failed writing message.", EventName = "FailedWritingMessage")]
52[LoggerMessage(11, LogLevel.Warning, "Error processing message for internal server message.", EventName = "InternalMessageFailed")]
55[LoggerMessage(12, LogLevel.Error, "Received a client result for protocol {HubProtocol} which is not supported by this server. This likely means you have different versions of your server deployed.", EventName = "MismatchedServers")]
58[LoggerMessage(13, LogLevel.Error, "Error forwarding client result with ID '{InvocationID}' to server.", EventName = "ErrorForwardingResult")]
61[LoggerMessage(14, LogLevel.Error, "Error connecting to Redis.", EventName = "ErrorConnecting")]
64[LoggerMessage(15, LogLevel.Warning, "Error parsing client result with protocol {HubProtocol}.", EventName = "ErrorParsingResult")]
70if (logger.IsEnabled(LogLevel.Debug))
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (12)
Microsoft.AspNetCore.SignalR.Tests.Utils (7)
src\Shared\SignalR\LogSinkProvider.cs (3)
32public void Log<TState>(string categoryName, LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
66public bool IsEnabled(LogLevel logLevel)
71public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.AspNetCore.SpaProxy (7)
Microsoft.AspNetCore.SpaServices.Extensions (3)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (5)
ListLoggerFactory.cs (5)
28public List<(LogLevel Level, EventId Id, string Message, object State, Exception Exception)> Log => Logger.LoggedEvents;
68public List<(LogLevel, EventId, string, object, Exception)> LoggedEvents { get; }
69= new List<(LogLevel, EventId, string, object, Exception)>();
80LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
94public bool IsEnabled(LogLevel logLevel) => true;
Microsoft.AspNetCore.StaticAssets (16)
LoggerExtensions.cs (15)
11[LoggerMessage(1, LogLevel.Debug, "{Method} requests are not supported", EventName = "MethodNotSupported")]
14[LoggerMessage(2, LogLevel.Information, "Sending file. Request path: '{VirtualPath}'. Physical path: '{PhysicalPath}'", EventName = "FileServed")]
26[LoggerMessage(15, LogLevel.Debug, "Static files was skipped as the request already matched an endpoint.", EventName = "EndpointMatched")]
29[LoggerMessage(3, LogLevel.Debug, "The request path {Path} does not match the path filter", EventName = "PathMismatch")]
32[LoggerMessage(4, LogLevel.Debug, "The request path {Path} does not match a supported file type", EventName = "FileTypeNotSupported")]
35[LoggerMessage(5, LogLevel.Debug, "The request path {Path} does not match an existing file", EventName = "FileNotFound")]
38[LoggerMessage(6, LogLevel.Information, "The file {Path} was not modified", EventName = "FileNotModified")]
41[LoggerMessage(7, LogLevel.Information, "Precondition for {Path} failed", EventName = "PreconditionFailed")]
44[LoggerMessage(8, LogLevel.Debug, "Handled. Status code: {StatusCode} File: {Path}", EventName = "Handled")]
47[LoggerMessage(9, LogLevel.Warning, "Range not satisfiable for {Path}", EventName = "RangeNotSatisfiable")]
50[LoggerMessage(10, LogLevel.Information, "Sending {Range} of file {Path}", EventName = "SendingFileRange")]
53[LoggerMessage(11, LogLevel.Debug, "Copying {Range} of file {Path} to the response body", EventName = "CopyingFileRange")]
56[LoggerMessage(14, LogLevel.Debug, "The file transmission was cancelled", EventName = "WriteCancelled")]
59[LoggerMessage(16, LogLevel.Warning,
63[LoggerMessage(17, LogLevel.Warning,
Microsoft.AspNetCore.StaticFiles (14)
LoggerExtensions.cs (14)
14[LoggerMessage(1, LogLevel.Debug, "{Method} requests are not supported", EventName = "MethodNotSupported")]
17[LoggerMessage(2, LogLevel.Information, "Sending file. Request path: '{VirtualPath}'. Physical path: '{PhysicalPath}'", EventName = "FileServed")]
29[LoggerMessage(15, LogLevel.Debug, "Static files was skipped as the request already matched an endpoint.", EventName = "EndpointMatched")]
32[LoggerMessage(3, LogLevel.Debug, "The request path {Path} does not match the path filter", EventName = "PathMismatch")]
35[LoggerMessage(4, LogLevel.Debug, "The request path {Path} does not match a supported file type", EventName = "FileTypeNotSupported")]
38[LoggerMessage(5, LogLevel.Debug, "The request path {Path} does not match an existing file", EventName = "FileNotFound")]
41[LoggerMessage(6, LogLevel.Information, "The file {Path} was not modified", EventName = "FileNotModified")]
44[LoggerMessage(7, LogLevel.Information, "Precondition for {Path} failed", EventName = "PreconditionFailed")]
47[LoggerMessage(8, LogLevel.Debug, "Handled. Status code: {StatusCode} File: {Path}", EventName = "Handled")]
50[LoggerMessage(9, LogLevel.Warning, "Range not satisfiable for {Path}", EventName = "RangeNotSatisfiable")]
53[LoggerMessage(10, LogLevel.Information, "Sending {Range} of file {Path}", EventName = "SendingFileRange")]
56[LoggerMessage(11, LogLevel.Debug, "Copying {Range} of file {Path} to the response body", EventName = "CopyingFileRange")]
59[LoggerMessage(14, LogLevel.Debug, "The file transmission was cancelled", EventName = "WriteCancelled")]
62[LoggerMessage(16, LogLevel.Warning,
Microsoft.AspNetCore.TestHost.Tests (6)
Microsoft.AspNetCore.WebSockets (3)
Microsoft.CodeAnalysis.LanguageServer (34)
Logging\LspLogMessageLogger.cs (10)
26public bool IsEnabled(LogLevel logLevel)
31public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
59if (message != null && logLevel != LogLevel.None)
78private static MessageType LogLevelToMessageType(LogLevel logLevel)
82LogLevel.Trace => MessageType.Log,
83LogLevel.Debug => MessageType.Debug,
84LogLevel.Information => MessageType.Info,
85LogLevel.Warning => MessageType.Warning,
86LogLevel.Error => MessageType.Error,
87LogLevel.Critical => MessageType.Error,
Microsoft.CodeAnalysis.LanguageServer.UnitTests (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild (5)
Microsoft.Extensions.Caching.Memory (3)
Microsoft.Extensions.Caching.StackExchangeRedis (2)
Microsoft.Extensions.Diagnostics.HealthChecks (15)
DefaultHealthCheckService.cs (9)
205[LoggerMessage(EventIds.HealthCheckProcessingBeginId, LogLevel.Debug, "Running health checks", EventName = EventIds.HealthCheckProcessingBeginName)]
211[LoggerMessage(EventIds.HealthCheckProcessingEndId, LogLevel.Debug, "Health check processing with combined status {HealthStatus} completed after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckProcessingEndName)]
214[LoggerMessage(EventIds.HealthCheckBeginId, LogLevel.Debug, "Running health check {HealthCheckName}", EventName = EventIds.HealthCheckBeginName)]
222[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Debug, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)]
225[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Warning, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)]
228[LoggerMessage(EventIds.HealthCheckEndId, LogLevel.Error, HealthCheckEndText, EventName = EventIds.HealthCheckEndName)]
251[LoggerMessage(EventIds.HealthCheckErrorId, LogLevel.Error, "Health check {HealthCheckName} threw an unhandled exception after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckErrorName)]
259if (entry.Data.Count > 0 && logger.IsEnabled(LogLevel.Debug))
262LogLevel.Debug,
HealthCheckPublisherHostedService.cs (6)
252[LoggerMessage(EventIds.HealthCheckPublisherProcessingBeginId, LogLevel.Debug, "Running health check publishers", EventName = EventIds.HealthCheckPublisherProcessingBeginName)]
258[LoggerMessage(EventIds.HealthCheckPublisherProcessingEndId, LogLevel.Debug, "Health check publisher processing completed after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckPublisherProcessingEndName)]
261[LoggerMessage(EventIds.HealthCheckPublisherBeginId, LogLevel.Debug, "Running health check publisher '{HealthCheckPublisher}'", EventName = EventIds.HealthCheckPublisherBeginName)]
267[LoggerMessage(EventIds.HealthCheckPublisherEndId, LogLevel.Debug, "Health check '{HealthCheckPublisher}' completed after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckPublisherEndName)]
274[LoggerMessage(EventIds.HealthCheckPublisherErrorId, LogLevel.Error, "Health check {HealthCheckPublisher} threw an unhandled exception after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckPublisherErrorName)]
280[LoggerMessage(EventIds.HealthCheckPublisherTimeoutId, LogLevel.Error, "Health check {HealthCheckPublisher} was canceled after {ElapsedMilliseconds}ms", EventName = EventIds.HealthCheckPublisherTimeoutName)]
Microsoft.Extensions.Diagnostics.HealthChecks.Common (2)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (8)
TelemetryHealthChecksPublisherTests.cs (8)
23public static TheoryData<List<HealthStatus>, bool, int, string, LogLevel, string> PublishAsyncArgs => new()
30LogLevel.Debug,
38LogLevel.Warning,
46LogLevel.Warning,
54LogLevel.Debug,
62LogLevel.Warning,
71LogLevel.Warning,
83LogLevel expectedLogLevel,
Microsoft.Extensions.Diagnostics.Probes (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (9)
Windows\Log.cs (6)
12[LoggerMessage(1, LogLevel.Information, "Resource Monitoring is running inside a Job Object. For more information about Job Objects see https://aka.ms/job-objects")]
15[LoggerMessage(2, LogLevel.Information, "Resource Monitoring is running outside of Job Object. For more information about Job Objects see https://aka.ms/job-objects")]
18[LoggerMessage(3, LogLevel.Debug,
27[LoggerMessage(4, LogLevel.Debug,
35[LoggerMessage(5, LogLevel.Debug, "Computed CPU usage with CpuUsageKernelTicks = {cpuUsageKernelTicks}, CpuUsageUserTicks = {cpuUsageUserTicks}, OldCpuUsageTicks = {oldCpuUsageTicks}, TimeTickDelta = {timeTickDelta}, CpuUnits = {cpuUnits}, CpuPercentage = {cpuPercentage}.")]
45[LoggerMessage(6, LogLevel.Debug,
Microsoft.Extensions.Diagnostics.Testing (15)
Logging\FakeLogger.cs (4)
22private readonly ConcurrentDictionary<LogLevel, bool> _disabledLevels = new(); // used as a set, the value is ignored
63public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
80public void ControlLevel(LogLevel logLevel, bool enabled) => _ = enabled ? _disabledLevels.TryRemove(logLevel, out _) : _disabledLevels.TryAdd(logLevel, false);
87public bool IsEnabled(LogLevel logLevel) => !_disabledLevels.ContainsKey(logLevel);
Logging\FakeLogRecord.cs (9)
29public FakeLogRecord(LogLevel level, EventId id, object? state, Exception? exception, string message, IReadOnlyList<object?> scopes, string? category, bool enabled, DateTimeOffset timestamp)
46public LogLevel Level { get; }
138LogLevel.Debug => "debug",
139LogLevel.Information => " info",
140LogLevel.Warning => " warn",
141LogLevel.Error => "error",
142LogLevel.Critical => " crit",
143LogLevel.Trace => "trace",
144LogLevel.None => " none",
Microsoft.Extensions.Diagnostics.Testing.Tests (38)
Logging\FakeLoggerTests.cs (29)
37Assert.Equal(LogLevel.Information, records[0].Level);
46Assert.Equal(LogLevel.Error, records[1].Level);
54Assert.Equal(LogLevel.Error, logger.LatestRecord.Level);
71logger.Log<int>(LogLevel.Error, new EventId(0), 42, null, (_, _) => "MESSAGE");
84logger.Log(LogLevel.Debug, new EventId(1), l, null, (_, _) => "Nothing");
99logger.Log<object?>(LogLevel.Error, new EventId(0), null, null, (_, _) => "MESSAGE");
113logger.Log<object?>(LogLevel.Error, new EventId(0), null, null, (_, _) => "MESSAGE");
129logger.Log(LogLevel.Error, new EventId(0), dt, null, (_, _) => "MESSAGE");
137logger.Log(LogLevel.Debug, new EventId(1), l, null, (_, _) => "Nothing");
151Assert.True(logger.IsEnabled(LogLevel.Trace));
152Assert.True(logger.IsEnabled(LogLevel.Debug));
153Assert.True(logger.IsEnabled(LogLevel.Information));
154Assert.True(logger.IsEnabled(LogLevel.Warning));
155Assert.True(logger.IsEnabled(LogLevel.Error));
156Assert.True(logger.IsEnabled(LogLevel.Critical));
157Assert.True(logger.IsEnabled((LogLevel)42));
159logger.ControlLevel(LogLevel.Debug, false);
160logger.ControlLevel((LogLevel)42, false);
162Assert.True(logger.IsEnabled(LogLevel.Trace));
163Assert.False(logger.IsEnabled(LogLevel.Debug));
164Assert.True(logger.IsEnabled(LogLevel.Information));
165Assert.True(logger.IsEnabled(LogLevel.Warning));
166Assert.True(logger.IsEnabled(LogLevel.Error));
167Assert.True(logger.IsEnabled(LogLevel.Critical));
168Assert.False(logger.IsEnabled((LogLevel)42));
174logger.ControlLevel(LogLevel.Debug, true);
192logger.ControlLevel(LogLevel.Debug, false);
204FilteredLevels = new HashSet<LogLevel>()
206options.FilteredLevels.Add(LogLevel.Error);
Microsoft.Extensions.Hosting (9)
Microsoft.Extensions.Hosting.Testing (2)
Microsoft.Extensions.Http (19)
Logging\LogHelper.cs (15)
42LogLevel.Information,
48LogLevel.Information,
53LogLevel.Information,
60LogLevel.Information,
65LogLevel.Information,
70LogLevel.Information,
98if (logger.IsEnabled(LogLevel.Information))
103if (logger.IsEnabled(LogLevel.Trace))
106LogLevel.Trace,
118if (logger.IsEnabled(LogLevel.Trace))
121LogLevel.Trace,
142if (logger.IsEnabled(LogLevel.Trace))
145LogLevel.Trace,
157if (logger.IsEnabled(LogLevel.Trace))
160LogLevel.Trace,
Microsoft.Extensions.Http.Diagnostics (11)
Logging\Internal\Log.cs (7)
38public static void OutgoingRequest(ILogger logger, LogLevel level, LogRecord record)
45OutgoingRequest(logger, LogLevel.Error, 2, nameof(OutgoingRequestError), record, exception);
48[LoggerMessage(LogLevel.Error, RequestReadErrorMessage)]
56[LoggerMessage(LogLevel.Error, ResponseReadErrorMessage)]
64[LoggerMessage(LogLevel.Error, LoggerContextMissingMessage)]
72[LoggerMessage(LogLevel.Error, EnrichmentErrorMessage)]
83ILogger logger, LogLevel level, int eventId, string eventName, LogRecord record, Exception? exception = null)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (3)
Microsoft.Extensions.Http.Diagnostics.Tests (11)
Microsoft.Extensions.Identity.Core (6)
Microsoft.Extensions.Localization (1)
Microsoft.Extensions.Logging (69)
FilterLoggingBuilderExtensions.cs (20)
20public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<string?, string?, LogLevel, bool> filter) =>
29public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<string?, LogLevel, bool> categoryLevelFilter) =>
39public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, Func<string?, LogLevel, bool> categoryLevelFilter) where T : ILoggerProvider =>
48public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, Func<LogLevel, bool> levelFilter) =>
58public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
68public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, string? category, LogLevel level) =>
79public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, string? category, LogLevel level) where T : ILoggerProvider =>
89public static ILoggingBuilder AddFilter(this ILoggingBuilder builder, string? category, Func<LogLevel, bool> levelFilter) =>
100public static ILoggingBuilder AddFilter<T>(this ILoggingBuilder builder, string? category, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
109public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, Func<string?, string?, LogLevel, bool> filter) =>
118public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, Func<string?, LogLevel, bool> categoryLevelFilter) =>
128public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, Func<string?, LogLevel, bool> categoryLevelFilter) where T : ILoggerProvider =>
137public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, Func<LogLevel, bool> levelFilter) =>
147public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
157public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, string? category, LogLevel level) =>
168public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, string? category, LogLevel level) where T : ILoggerProvider =>
178public static LoggerFilterOptions AddFilter(this LoggerFilterOptions builder, string? category, Func<LogLevel, bool> levelFilter) =>
189public static LoggerFilterOptions AddFilter<T>(this LoggerFilterOptions builder, string? category, Func<LogLevel, bool> levelFilter) where T : ILoggerProvider =>
201LogLevel? level = null,
202Func<string?, string?, LogLevel, bool>? filter = null)
Logger.cs (17)
27public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
52static void LoggerLog(LogLevel logLevel, EventId eventId, ILogger logger, Exception? exception, Func<TState, Exception?, string> formatter, ref List<Exception>? exceptions, in TState state)
66public bool IsEnabled(LogLevel logLevel)
97static bool LoggerIsEnabled(LogLevel logLevel, ILogger logger, ref List<Exception>? exceptions)
224public LogLevel? MinLevel => DebuggerDisplayFormatting.CalculateEnabledLogLevel(logger);
232public LogLevel LogLevel => CalculateEnabledLogLevel(messageLogger) ?? LogLevel.None;
234private static LogLevel? CalculateEnabledLogLevel(MessageLogger? logger)
241ReadOnlySpan<LogLevel> logLevels =
243LogLevel.Critical,
244LogLevel.Error,
245LogLevel.Warning,
246LogLevel.Information,
247LogLevel.Debug,
248LogLevel.Trace,
251LogLevel? minimumLevel = null;
254foreach (LogLevel logLevel in logLevels)
LoggerInformation.cs (5)
11public MessageLogger(ILogger logger, string category, string? providerTypeFullName, LogLevel? minLevel, Func<string?, string?, LogLevel, bool>? filter)
26public LogLevel? MinLevel { get; }
28public Func<string?, string?, LogLevel, bool>? Filter { get; }
30public bool IsEnabled(LogLevel level)
Microsoft.Extensions.Logging.Abstractions (85)
LoggerExtensions.cs (28)
32logger.Log(LogLevel.Debug, eventId, exception, message, args);
49logger.Log(LogLevel.Debug, eventId, message, args);
66logger.Log(LogLevel.Debug, exception, message, args);
82logger.Log(LogLevel.Debug, message, args);
102logger.Log(LogLevel.Trace, eventId, exception, message, args);
119logger.Log(LogLevel.Trace, eventId, message, args);
136logger.Log(LogLevel.Trace, exception, message, args);
152logger.Log(LogLevel.Trace, message, args);
172logger.Log(LogLevel.Information, eventId, exception, message, args);
189logger.Log(LogLevel.Information, eventId, message, args);
206logger.Log(LogLevel.Information, exception, message, args);
222logger.Log(LogLevel.Information, message, args);
242logger.Log(LogLevel.Warning, eventId, exception, message, args);
259logger.Log(LogLevel.Warning, eventId, message, args);
276logger.Log(LogLevel.Warning, exception, message, args);
292logger.Log(LogLevel.Warning, message, args);
312logger.Log(LogLevel.Error, eventId, exception, message, args);
329logger.Log(LogLevel.Error, eventId, message, args);
346logger.Log(LogLevel.Error, exception, message, args);
362logger.Log(LogLevel.Error, message, args);
382logger.Log(LogLevel.Critical, eventId, exception, message, args);
399logger.Log(LogLevel.Critical, eventId, message, args);
416logger.Log(LogLevel.Critical, exception, message, args);
432logger.Log(LogLevel.Critical, message, args);
442public static void Log(this ILogger logger, LogLevel logLevel, string? message, params object?[] args)
455public static void Log(this ILogger logger, LogLevel logLevel, EventId eventId, string? message, params object?[] args)
468public static void Log(this ILogger logger, LogLevel logLevel, Exception? exception, string? message, params object?[] args)
482public static void Log(this ILogger logger, LogLevel logLevel, EventId eventId, Exception? exception, string? message, params object?[] args)
LoggerMessage.cs (28)
126/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
130public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString)
136/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
141public static Action<ILogger, Exception?> Define(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
168/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
172public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString)
179/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
184public static Action<ILogger, T1, Exception?> Define<T1>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
212/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
216public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString)
224/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
229public static Action<ILogger, T1, T2, Exception?> Define<T1, T2>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
258/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
262public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString)
271/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
276public static Action<ILogger, T1, T2, T3, Exception?> Define<T1, T2, T3>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
306/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
310public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString)
320/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
325public static Action<ILogger, T1, T2, T3, T4, Exception?> Define<T1, T2, T3, T4>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
356/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
360public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString)
371/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
376public static Action<ILogger, T1, T2, T3, T4, T5, Exception?> Define<T1, T2, T3, T4, T5>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
408/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
412public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString)
424/// <param name="logLevel">The <see cref="LogLevel"/>.</param>
429public static Action<ILogger, T1, T2, T3, T4, T5, T6, Exception?> Define<T1, T2, T3, T4, T5, T6>(LogLevel logLevel, EventId eventId, string formatString, LogDefineOptions? options)
Microsoft.Extensions.Logging.AzureAppServices (10)
BatchingLogger.cs (3)
26public bool IsEnabled(LogLevel logLevel)
31public void Log<TState>(DateTimeOffset timestamp, LogLevel logLevel, EventId _, TState state, Exception exception, Func<TState, Exception, string> formatter)
70public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
Microsoft.Extensions.Logging.Configuration (3)
Microsoft.Extensions.Logging.Console (51)
ConsoleLoggerExtensions.Obsolete.cs (6)
53public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Logging.LogLevel minLevel, bool includeScopes)
55factory.AddConsole((n, l) => l >= LogLevel.Information, includeScopes);
67public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Logging.LogLevel minLevel)
83factory.AddConsole((n, l) => l >= LogLevel.Information, includeScopes);
96public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func<string, Logging.LogLevel, bool> filter, bool includeScopes)
110public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func<string, Logging.LogLevel, bool> filter)
JsonConsoleFormatter.cs (8)
56private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter textWriter, string? message, LogLevel logLevel,
126private static string GetLogLevelString(LogLevel logLevel)
130LogLevel.Trace => "Trace",
131LogLevel.Debug => "Debug",
132LogLevel.Information => "Information",
133LogLevel.Warning => "Warning",
134LogLevel.Error => "Error",
135LogLevel.Critical => "Critical",
SimpleConsoleFormatter.cs (16)
16private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length);
68private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter textWriter, string message, LogLevel logLevel,
163private static string GetLogLevelString(LogLevel logLevel)
167LogLevel.Trace => "trce",
168LogLevel.Debug => "dbug",
169LogLevel.Information => "info",
170LogLevel.Warning => "warn",
171LogLevel.Error => "fail",
172LogLevel.Critical => "crit",
177private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel)
191LogLevel.Trace => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
192LogLevel.Debug => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
193LogLevel.Information => new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black),
194LogLevel.Warning => new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black),
195LogLevel.Error => new ConsoleColors(ConsoleColor.Black, ConsoleColor.DarkRed),
196LogLevel.Critical => new ConsoleColors(ConsoleColor.White, ConsoleColor.DarkRed),
SystemdConsoleFormatter.cs (8)
58private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter textWriter, string message, LogLevel logLevel, string category,
120private static string GetSyslogSeverityString(LogLevel logLevel)
125LogLevel.Trace => "<7>",
126LogLevel.Debug => "<7>", // debug-level messages
127LogLevel.Information => "<6>", // informational messages
128LogLevel.Warning => "<4>", // warning conditions
129LogLevel.Error => "<3>", // error conditions
130LogLevel.Critical => "<2>", // critical conditions
Microsoft.Extensions.Logging.Debug (7)
Microsoft.Extensions.Logging.EventLog (16)
Microsoft.Extensions.Logging.EventSource (33)
LoggingEventSource.cs (26)
136LogLevel Level,
187LogLevel Level,
251LogLevel Level,
406private static LoggerFilterRule[] ParseFilterSpec(string? filterSpec, LogLevel defaultLevel)
416return new[] { new LoggerFilterRule(typeof(EventSourceLoggerProvider).FullName, null, LogLevel.None, null) };
429rules.Add(new LoggerFilterRule(typeof(EventSourceLoggerProvider).FullName, null, LogLevel.None, null));
435LogLevel level = defaultLevel;
469private static bool TryParseLevel(LogLevel defaultLevel, string levelString, out LogLevel ret)
484ret = LogLevel.Trace;
487ret = LogLevel.Debug;
490ret = LogLevel.Information;
493ret = LogLevel.Warning;
496ret = LogLevel.Error;
499ret = LogLevel.Critical;
506if (!(LogLevel.Trace <= (LogLevel)level && (LogLevel)level <= LogLevel.None))
510ret = (LogLevel)level;
517private LogLevel GetDefaultLevel()
523return LogLevel.Debug;
528return LogLevel.Information;
533return LogLevel.Warning;
538return LogLevel.Error;
541return LogLevel.Critical;
Microsoft.Extensions.Logging.TraceSource (9)
Microsoft.Extensions.ML (8)
Microsoft.Extensions.ServiceDiscovery (14)
Configuration\ConfigurationServiceEndpointProvider.Log.cs (6)
13[LoggerMessage(1, LogLevel.Debug, "Skipping endpoint resolution for service '{ServiceName}': '{Reason}'.", EventName = "SkippedResolution")]
16[LoggerMessage(2, LogLevel.Debug, "Using configuration from path '{Path}' to resolve endpoint '{EndpointName}' for service '{ServiceName}'.", EventName = "UsingConfigurationPath")]
19[LoggerMessage(3, LogLevel.Debug, "No valid endpoint configuration was found for service '{ServiceName}' from path '{Path}'.", EventName = "ServiceConfigurationNotFound")]
22[LoggerMessage(4, LogLevel.Debug, "Endpoints configured for service '{ServiceName}' from path '{Path}': {ConfiguredEndpoints}.", EventName = "ConfiguredEndpoints")]
27if (!logger.IsEnabled(LogLevel.Debug))
47[LoggerMessage(5, LogLevel.Debug, "No valid endpoint configuration was found for endpoint '{EndpointName}' on service '{ServiceName}' from path '{Path}'.", EventName = "EndpointConfigurationNotFound")]
ServiceEndpointWatcher.Log.cs (5)
12[LoggerMessage(1, LogLevel.Debug, "Resolving endpoints for service '{ServiceName}'.", EventName = "ResolvingEndpoints")]
15[LoggerMessage(2, LogLevel.Debug, "Endpoint resolution is pending for service '{ServiceName}'.", EventName = "ResolutionPending")]
18[LoggerMessage(3, LogLevel.Debug, "Resolved {Count} endpoints for service '{ServiceName}': {Endpoints}.", EventName = "ResolutionSucceeded")]
23if (logger.IsEnabled(LogLevel.Debug))
39[LoggerMessage(4, LogLevel.Error, "Error resolving endpoints for service '{ServiceName}'.", EventName = "ResolutionFailed")]
Microsoft.Extensions.ServiceDiscovery.Dns (5)
DnsServiceEndpointProviderBase.Log.cs (5)
12[LoggerMessage(1, LogLevel.Trace, "Resolving endpoints for service '{ServiceName}' using DNS SRV lookup for name '{RecordName}'.", EventName = "SrvQuery")]
15[LoggerMessage(2, LogLevel.Trace, "Resolving endpoints for service '{ServiceName}' using host lookup for name '{RecordName}'.", EventName = "AddressQuery")]
18[LoggerMessage(3, LogLevel.Debug, "Skipping endpoint resolution for service '{ServiceName}': '{Reason}'.", EventName = "SkippedResolution")]
21[LoggerMessage(4, LogLevel.Debug, "Service name '{ServiceName}' is not a valid URI or DNS name.", EventName = "ServiceNameIsNotUriOrDnsName")]
24[LoggerMessage(5, LogLevel.Debug, "DNS SRV query cannot be constructed for service name '{ServiceName}' because no DNS namespace was configured or detected.", EventName = "NoDnsSuffixFound")]
Microsoft.Extensions.Telemetry (16)
Logging\ExtendedLogger.cs (4)
40public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
91public bool IsEnabled(LogLevel logLevel)
208private void ModernPath(LogLevel logLevel, EventId eventId, LoggerMessageState msgState, Exception? exception, Func<LoggerMessageState, Exception?, string> formatter)
298private void LegacyPath<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Logging\Import\LoggerInformation.cs (7)
20public MessageLogger(ILogger logger, string? category, string? providerTypeFullName, LogLevel? minLevel, Func<string?, string?, LogLevel, bool>? filter)
33public Func<LogLevel, bool> LoggerIsEnabled { get; }
35public Action<LogLevel, EventId, ExtendedLogger.ModernTagJoiner, Exception?, Func<ExtendedLogger.ModernTagJoiner, Exception?, string>> LoggerLog { get; }
43public LogLevel? MinLevel { get; }
45public Func<string?, string?, LogLevel, bool>? Filter { get; }
47public bool IsNotFilteredOut(LogLevel level)
Microsoft.Extensions.Telemetry.PerformanceTests (10)
Microsoft.Extensions.Telemetry.Tests (29)
Logging\ExtendedLoggerFactoryTests.cs (4)
554public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
560public bool IsEnabled(LogLevel logLevel)
592public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
602public bool IsEnabled(LogLevel logLevel)
Logging\ExtendedLoggerTests.cs (23)
68logger.Log(LogLevel.Warning, new EventId(2, "ID2"), lms, null, (_, _) => "MSG2");
153logger.Log(LogLevel.Warning, new EventId(2, "ID2"), lms, null, (_, _) => "MSG2");
213logger.Log<object?>(LogLevel.Error, new EventId(0, "ID0"), null, null, (_, _) => "MSG0");
214logger.Log<object?>(LogLevel.Error, new EventId(0, "ID0b"), null, null, (_, _) => "MSG0b");
217logger.Log(LogLevel.Warning, new EventId(2, "ID2"), (LoggerMessageState?)null, null, (_, _) => "MSG2");
218logger.Log(LogLevel.Warning, new EventId(2, "ID2b"), (LoggerMessageState?)null, null, (_, _) => "MSG2b");
278logger.Log(LogLevel.Warning, new EventId(0, "ID0"), e, null, (_, _) => "MSG0");
318Assert.False(filteredLogger.IsEnabled(LogLevel.Warning));
319Assert.True(unfilteredLogger.IsEnabled(LogLevel.Warning));
322fake.ControlLevel(LogLevel.Warning, false);
324Assert.False(filteredLogger.IsEnabled(LogLevel.Warning));
325Assert.False(unfilteredLogger.IsEnabled(LogLevel.Warning));
347logger.Log(LogLevel.Warning, new EventId(0, "ID0"), "PAYLOAD", null, (_, _) => "MSG0");
380logger.Log(LogLevel.Information, new EventId(0, "ID0"), "PAYLOAD", null, (_, _) => "MSG0");
451logger.Log<object?>(LogLevel.Error, new EventId(0, "ID0"), null, null, (_, _) => "MSG0");
452logger.Log<object?>(LogLevel.Error, new EventId(0, "ID0b"), null, ex, (_, _) => "MSG0b");
455logger.Log(LogLevel.Warning, new EventId(2, "ID2"), lms, null, (_, _) => "MSG2");
456logger.Log(LogLevel.Warning, new EventId(2, "ID2b"), lms, ex, (_, _) => "MSG2b");
647builder.AddFilter(null, LogLevel.None);
811public bool IsEnabled(LogLevel logLevel)
822LogLevel logLevel,
888public bool IsEnabled(LogLevel logLevel) => true;
889public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter) => _provider.State = state?.ToString();
Logging\SerialExtendedLoggerTests.cs (2)
52logger.Log<object?>(LogLevel.Error, new EventId(0, "ID0"), null, null, (_, _) => "MSG0");
55logger.Log(LogLevel.Warning, new EventId(2, "ID2"), (LoggerMessageState?)null, null, (_, _) => "MSG2");
Microsoft.Gen.Logging.Generated.Tests (353)
LoggerMessageAttributeTests.cs (7)
122AttributeTestExtensions.M6(logger, LogLevel.Critical, "arg0", "arg1");
123AssertWhenDefaultLogMethodCtor(collector, LogLevel.Critical, ("p0", "----"), ("p1", "arg1"));
126AttributeTestExtensions.M7(logger, LogLevel.Warning, "arg_0", "arg_1");
127AssertWhenDefaultLogMethodCtor(collector, LogLevel.Warning, ("p0", "-----"), ("p1", "arg_1"));
149new NonStaticTestClass(logger).M3(LogLevel.Information, "arg_0");
150AssertWhenDefaultLogMethodCtor(collector, LogLevel.Information, ("p0", "-----"));
153private static void AssertWhenDefaultLogMethodCtor(FakeLogCollector collector, LogLevel expectedLevel, params (string key, string value)[] expectedState)
LogMethodTests.cs (79)
25Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
32Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
39Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
52Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
65fakeLogger.ControlLevel(LogLevel.Trace, false);
66fakeLogger.ControlLevel(LogLevel.Debug, false);
67fakeLogger.ControlLevel(LogLevel.Information, false);
68fakeLogger.ControlLevel(LogLevel.Warning, false);
69fakeLogger.ControlLevel(LogLevel.Error, false);
70fakeLogger.ControlLevel(LogLevel.Critical, false);
72LevelTestExtensions.M8(logger, LogLevel.Trace);
73LevelTestExtensions.M8(logger, LogLevel.Debug);
74LevelTestExtensions.M8(logger, LogLevel.Information);
75LevelTestExtensions.M8(logger, LogLevel.Warning);
76LevelTestExtensions.M8(logger, LogLevel.Error);
77LevelTestExtensions.M8(logger, LogLevel.Critical);
211CollectionTestExtensions.M9(logger, LogLevel.Critical, 0, new ArgumentException("Foo"), 1);
225Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
230ConstructorVariationsTestExtensions.M1(logger, LogLevel.Error, "One");
233Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
241Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
246ConstructorVariationsTestExtensions.M3(logger, LogLevel.Error, "Three");
249Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
257Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
262ConstructorVariationsTestExtensions.M5(logger, LogLevel.Error, "Five");
265Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
273Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
278ConstructorVariationsTestExtensions.M7(logger, LogLevel.Information, "Seven");
284Assert.Equal(LogLevel.Information, logRecord.Level);
295Assert.Equal(LogLevel.Trace, logRecord.Level);
310Assert.Equal(LogLevel.Trace, collector.LatestRecord.Level);
317Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
324Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
331Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
335MessageTestExtensions.M6(logger, LogLevel.Warning, "p", "q");
338Assert.Equal(LogLevel.Warning, collector.LatestRecord.Level);
346Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
363Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
370Assert.Equal(LogLevel.Trace, collector.LatestRecord.Level);
374o.M2(LogLevel.Warning, "param");
380Assert.Equal(LogLevel.Warning, logRecord.Level);
405Assert.Equal(LogLevel.Information, collector.LatestRecord.Level);
412Assert.Equal(LogLevel.Warning, collector.LatestRecord.Level);
419Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
426Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
433Assert.Equal(LogLevel.None, collector.LatestRecord.Level);
440Assert.Equal((LogLevel)42, collector.LatestRecord.Level);
444LevelTestExtensions.M8(logger, LogLevel.Critical);
447Assert.Equal(LogLevel.Critical, collector.LatestRecord.Level);
451LevelTestExtensions.M9(LogLevel.Information, logger);
454Assert.Equal(LogLevel.Information, collector.LatestRecord.Level);
458LevelTestExtensions.M10(logger, LogLevel.Warning);
461Assert.Equal(LogLevel.Warning, collector.LatestRecord.Level);
465LevelTestExtensions.M11(logger, LogLevel.Error);
467Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
483Assert.Equal(LogLevel.Warning, collector.LatestRecord.Level);
487instance.NoParamsWithLevel(LogLevel.Information);
490Assert.Equal(LogLevel.Information, collector.LatestRecord.Level);
494instance.NoParamsWithLevel(LogLevel.Error);
497Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
528Assert.Equal(LogLevel.Trace, collector.LatestRecord.Level);
535Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
542Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
547ExceptionTestExtensions.M3(exception, logger, LogLevel.Error);
553Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
566Assert.Equal(LogLevel.Trace, collector.LatestRecord.Level);
571EventNameTestExtensions.M1(LogLevel.Warning, logger, "Eight");
577Assert.Equal(LogLevel.Warning, logRecord.Level);
592Assert.Equal(LogLevel.Error, collector.LatestRecord.Level);
599Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
606Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
613Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
620Assert.Equal(LogLevel.Debug, collector.LatestRecord.Level);
705fakeLogger.ControlLevel(LogLevel.Information, false);
710SkipEnabledCheckTestExtensions.LoggerMethodWithFalseSkipEnabledCheck(logger, LogLevel.Information, "p1");
753AtSymbolsTestExtensions.UseAtSymbol3(logger, LogLevel.Debug, "42", 42);
759AtSymbolsTestExtensions.UseAtSymbol4(logger, LogLevel.Debug, "42", 42, new ArgumentException("Foo"));
766AtSymbolsTestExtensions.M3(logger, LogLevel.Debug, o);
770AtSymbolsTestExtensions.M5(logger, LogLevel.Debug, o);
LogPropertiesRedactionTests.cs (6)
52instance.DefaultAttrCtorLogPropertiesWithRedaction(LogLevel.Information, "arg0", classToRedact);
56Assert.Equal(LogLevel.Information, collector.LatestRecord.Level);
106LogNoParamsDefaultCtor(logger, LogLevel.Warning, classToRedact);
110Assert.Equal(LogLevel.Warning, collector.LatestRecord.Level);
161LogTwoParamsDefaultCtor(logger, LogLevel.None, "string_prop", classToRedact);
165Assert.Equal(LogLevel.None, collector.LatestRecord.Level);
LogPropertiesTests.cs (12)
77LogPropertiesOmitParameterNameExtensions.M2(_logger, LogLevel.Critical, props);
229Assert.Equal(LogLevel.Debug, _logger.Collector.LatestRecord.Level);
302Assert.Equal(LogLevel.Information, _logger.Collector.LatestRecord.Level);
323Assert.Equal(LogLevel.Information, _logger.Collector.LatestRecord.Level);
343Assert.Equal(LogLevel.Information, _logger.Collector.LatestRecord.Level);
365Assert.Equal(LogLevel.Information, latestRecord.Level);
468LogMethodDefaultAttrCtor(_logger, LogLevel.Critical, classToLog);
474Assert.Equal(LogLevel.Critical, latestRecord.Level);
501Assert.Equal(LogLevel.Information, latestRecord.Level);
525Assert.Equal(LogLevel.Debug, latestRecord.Level);
550Assert.Equal(LogLevel.Debug, latestRecord.Level);
576Assert.Equal(LogLevel.Debug, latestRecord.Level);
TagProviderTests.cs (24)
34Assert.Equal(LogLevel.Warning, latestRecord.Level);
57Assert.Equal(LogLevel.Information, latestRecord.Level);
78new NonStaticTestClass(_logger).DefaultAttrCtorLogPropertiesWithProvider(LogLevel.Debug, StringParamValue, classToLog);
84Assert.Equal(LogLevel.Debug, latestRecord.Level);
101TagProviderExtensions.DefaultAttributeCtor(_logger, LogLevel.Trace, classToLog);
107Assert.Equal(LogLevel.Trace, latestRecord.Level);
122TagProviderExtensions.Nullable(_logger, LogLevel.Trace, null);
128Assert.Equal(LogLevel.Trace, latestRecord.Level);
133TagProviderExtensions.Nullable(_logger, LogLevel.Trace, 42);
139Assert.Equal(LogLevel.Trace, latestRecord.Level);
163Assert.Equal(LogLevel.Warning, latestRecord.Level);
183LogPropertiesOmitParameterNameExtensions.M3(_logger, LogLevel.Error, props);
189Assert.Equal(LogLevel.Error, latestRecord.Level);
208Assert.Equal(LogLevel.Warning, latestRecord.Level);
227Assert.Equal(LogLevel.Warning, latestRecord.Level);
247Assert.Equal(LogLevel.Warning, latestRecord.Level);
269Assert.Equal(LogLevel.Debug, latestRecord.Level);
290Assert.Equal(LogLevel.Information, latestRecord.Level);
307TagProviderExtensions.Enumerable(_logger, LogLevel.Debug, a);
311Assert.Equal(LogLevel.Debug, latestRecord.Level);
331Assert.Equal(LogLevel.Warning, latestRecord.Level);
358Assert.Equal(LogLevel.Warning, latestRecord.Level);
396Assert.Equal(LogLevel.Warning, latestRecord.Level);
421Assert.Equal(LogLevel.Warning, latestRecord.Level);
test\Generators\Microsoft.Gen.Logging\TestClasses\ArgTestExtensions.cs (10)
11[LoggerMessage(0, LogLevel.Error, "M1")]
14[LoggerMessage(1, LogLevel.Error, "M2 {p1}")]
17[LoggerMessage(2, LogLevel.Error, "M3 {p1} {p2}")]
20[LoggerMessage(3, LogLevel.Error, "M4")]
23[LoggerMessage(4, LogLevel.Error, "M5 {p2}")]
26[LoggerMessage(5, LogLevel.Error, "M6 {p2}")]
29[LoggerMessage(6, LogLevel.Error, "M7 {p1}")]
33[LoggerMessage(7, LogLevel.Error, "M8{p1}{p2}{p3}{p4}{p5}{p6}{p7}")]
36[LoggerMessage(8, LogLevel.Error, "M9 {p1} {p2} {p3} {p4} {p5} {p6} {p7}")]
40[LoggerMessage(9, LogLevel.Error, "M10{p1}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\AtSymbolsTestExtensions.cs (10)
18[LoggerMessage(0, LogLevel.Information, "M0 {event}")]
21[LoggerMessage(1, LogLevel.Information, "M1 {@myevent1}")]
25public static partial void UseAtSymbol3(ILogger logger, LogLevel level, string @myevent2, int otherevent);
28public static partial void UseAtSymbol4(ILogger logger, LogLevel level, string @myevent3, int otherevent, System.Exception ex);
31internal static partial void M2(ILogger logger, LogLevel level, string @event);
34internal static partial void M3(ILogger logger, LogLevel level, [LogProperties] SpecialNames @event);
36[LoggerMessage(LogLevel.Information, "M4 {class}")]
40internal static partial void M5(ILogger logger, LogLevel level, [LogProperties(OmitReferenceName = true)] SpecialNames @event);
42[LoggerMessage(LogLevel.Information, "M6 class {class}")]
45[LoggerMessage(LogLevel.Information, "M7 param {@param}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\AttributeTestExtensions.cs (11)
13[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
16[LoggerMessage(1, LogLevel.Debug, "M1 {p0} {p1}")]
19[LoggerMessage(2, LogLevel.Debug, "M2 {p0} {p1}")]
22[LoggerMessage(3, LogLevel.Debug, "M3 {p0} {p1} {p2} {p3}")]
30[LoggerMessage(4, LogLevel.Debug, "M4 {p0} {p1} {p2} {p3}")]
38[LoggerMessage(5, LogLevel.Debug, "M5 {p0} {p1} {p2} {p3} {p4} {p5} {p6} {p7} {p8} {p9} {p10}")]
56public static partial void M6(ILogger logger, LogLevel level,
60public static partial void M7(ILogger logger, LogLevel level,
63[LoggerMessage(8, LogLevel.Debug, "M8 {p0}")]
66[LoggerMessage(9, LogLevel.Debug, "M9 {p0}")]
69[LoggerMessage(10, LogLevel.Debug, "M10 {p0}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\CollectionTestExtensions.cs (10)
10[LoggerMessage(0, LogLevel.Error, "M0")]
13[LoggerMessage(1, LogLevel.Error, "M1{p0}")]
16[LoggerMessage(2, LogLevel.Error, "M2{p0}{p1}")]
19[LoggerMessage(3, LogLevel.Error, "M3{p0}{p1}{p2}")]
22[LoggerMessage(4, LogLevel.Error, "M4{p0}{p1}{p2}{p3}")]
25[LoggerMessage(5, LogLevel.Error, "M5{p0}{p1}{p2}{p3}{p4}")]
28[LoggerMessage(6, LogLevel.Error, "M6{p0}{p1}{p2}{p3}{p4}{p5}")]
32[LoggerMessage(7, LogLevel.Error, "M7{p0}{p1}{p2}{p3}{p4}{p5}{p6}")]
35[LoggerMessage(8, LogLevel.Error, "M8{p0}{p1}{p2}{p3}{p4}{p5}{p6}{p7}")]
40public static partial void M9(ILogger logger, LogLevel level, int p0, System.Exception ex, int p1);
test\Generators\Microsoft.Gen.Logging\TestClasses\ConstraintsTestExtensions.cs (7)
15[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
26[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
37[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
48[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
59[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
70[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
81[LoggerMessage(0, LogLevel.Debug, "M0{p0}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\ConstructorVariationsTestExtensions.cs (9)
10[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
14public static partial void M1(ILogger logger, LogLevel level, string p0);
16[LoggerMessage(LogLevel.Debug)]
20public static partial void M3(ILogger logger, LogLevel level, string p0);
22[LoggerMessage(LogLevel.Debug, "M4 {p0}")]
26public static partial void M5(ILogger logger, LogLevel level, string p0);
28[LoggerMessage(LogLevel.Debug)]
32public static partial void M7(ILogger logger, LogLevel level, string p0);
34[LoggerMessage(Level = LogLevel.Trace, EventName = "EN1", EventId = 42, Message = "M8", SkipEnabledCheck = true)]
test\Generators\Microsoft.Gen.Logging\TestClasses\EnumerableTestExtensions.cs (15)
12[LoggerMessage(0, LogLevel.Error, "M0")]
15[LoggerMessage(1, LogLevel.Error, "M1{p0}")]
18[LoggerMessage(2, LogLevel.Error, "M2{p0}{p1}")]
21[LoggerMessage(3, LogLevel.Error, "M3{p0}{p1}{p2}")]
24[LoggerMessage(4, LogLevel.Error, "M4{p0}{p1}{p2}{p3}")]
27[LoggerMessage(5, LogLevel.Error, "M5{p0}{p1}{p2}{p3}{p4}")]
30[LoggerMessage(6, LogLevel.Error, "M6{p0}{p1}{p2}{p3}{p4}{p5}")]
35[LoggerMessage(7, LogLevel.Error, "M7{p0}{p1}{p2}{p3}{p4}{p5}{p6}")]
38[LoggerMessage(8, LogLevel.Error, "M8{p0}{p1}{p2}{p3}{p4}{p5}{p6}{p7}")]
41[LoggerMessage(9, LogLevel.Error, "M9{p0}{p1}{p2}{p3}{p4}{p5}{p6}{p7}{p8}")]
44[LoggerMessage(10, LogLevel.Error, "M10{p1}{p2}{p3}")]
47[LoggerMessage(11, LogLevel.Error, "M11{p1}")]
50[LoggerMessage(12, LogLevel.Error, "M12{class}")]
53[LoggerMessage(13, LogLevel.Error, "M13{p1}")]
56[LoggerMessage(14, LogLevel.Error, "M14{p1}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\LevelTestExtensions.cs (12)
10[LoggerMessage(0, LogLevel.Trace, "M0")]
13[LoggerMessage(1, LogLevel.Debug, "M1")]
16[LoggerMessage(2, LogLevel.Information, "M2")]
19[LoggerMessage(3, LogLevel.Warning, "M3")]
22[LoggerMessage(4, LogLevel.Error, "M4")]
25[LoggerMessage(5, LogLevel.Critical, "M5")]
28[LoggerMessage(6, LogLevel.None, "M6")]
31[LoggerMessage(7, (LogLevel)42, "M7")]
35public static partial void M8(ILogger logger, LogLevel level);
38public static partial void M9(LogLevel level, ILogger logger);
42public static partial void M10(ILogger logger, LogLevel level);
47public static partial void M11(ILogger logger, LogLevel level);
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesExtensions.cs (8)
214[LoggerMessage(0, LogLevel.Debug, "Only {classToLog_StringProperty_1} as param")]
227[LoggerMessage(1, LogLevel.Information, "Both {StringProperty} and {ComplexParam} as params")]
230[LoggerMessage(2, LogLevel.Information, "Testing non-nullable struct here...")]
233[LoggerMessage(3, LogLevel.Information, "Testing nullable struct here...")]
236[LoggerMessage(4, LogLevel.Information, "Testing explicit nullable struct here...")]
239[LoggerMessage(5, LogLevel.Information, "Testing nullable property within class here...")]
243public static partial void LogMethodDefaultAttrCtor(ILogger logger, LogLevel level, [LogProperties] ClassAsParam? complexParam);
245[LoggerMessage(6, LogLevel.Information, "Testing interface-typed argument here...")]
test\Generators\Microsoft.Gen.Logging\TestClasses\MessageTestExtensions.cs (9)
10[LoggerMessage(0, LogLevel.Trace, null!)]
13[LoggerMessage(1, LogLevel.Debug, "")]
17[LoggerMessage(LogLevel.Debug)]
21[LoggerMessage(LogLevel.Trace)]
24[LoggerMessage(LogLevel.Debug, "")]
27[LoggerMessage(LogLevel.Debug, "{p1}")]
30[LoggerMessage(LogLevel.Debug, "\"Hello\" World")]
34public static partial void M6(ILogger logger, LogLevel logLevel, string value1, string value2);
36[LoggerMessage(LogLevel.Debug, "\"\n\r\\")]
test\Generators\Microsoft.Gen.Logging\TestClasses\NestedClassTestExtensions.cs (5)
21[LoggerMessage(8, LogLevel.Error, "M8")]
36[LoggerMessage(9, LogLevel.Debug, "M9")]
50[LoggerMessage(10, LogLevel.Debug, "M10")]
59[LoggerMessage(11, LogLevel.Debug, "M11")]
72[LoggerMessage(12, LogLevel.Debug, "M12")]
test\Generators\Microsoft.Gen.Logging\TestClasses\NonStaticTestClass.cs (11)
19[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
22[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
25[LoggerMessage(2, LogLevel.Debug, "M2 {p0} {p1} {p2}")]
29public partial void M3(LogLevel level, [PrivateData] string p0);
31[LoggerMessage(4, LogLevel.Information, "LogProperties: {P0}")]
34[LoggerMessage(5, LogLevel.Information, "LogProperties with provider: {P0}, {P1}")]
39[LoggerMessage(6, LogLevel.Information, "LogProperties with redaction: {P0}")]
46LogLevel level,
52LogLevel level,
56[LoggerMessage(7, LogLevel.Warning, "No params here...")]
60public partial void NoParamsWithLevel(LogLevel level);
test\Generators\Microsoft.Gen.Logging\TestClasses\NonStaticTestClasses.cs (9)
14[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
22[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
30[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
36[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
42[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
55[LoggerMessage(1, LogLevel.Debug, "M0 {p0}")]
69[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
75[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
86[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\NullableTestExtensions.cs (6)
11[LoggerMessage(0, LogLevel.Debug, "M0 {p0}")]
14[LoggerMessage(1, LogLevel.Debug, "M1 {p0}")]
17[LoggerMessage(3, LogLevel.Debug, "M3 {p0}")]
21[LoggerMessage(4, LogLevel.Debug, "M4 {p0} {p1} {p2} {p3} {p4} {p5} {p6} {p7} {p8}")]
24[LoggerMessage(5, LogLevel.Debug, "M5 {p0} {p1} {p2} {p3} {p4} {p5} {p6} {p7} {p8}")]
28[LoggerMessage(6, LogLevel.Debug, "M6 {p0}")]
test\Generators\Microsoft.Gen.Logging\TestClasses\SignatureTestExtensions.cs (15)
13[LoggerMessage(eventId: 10, level: LogLevel.Critical, message: "Message11")]
17[LoggerMessage(1, LogLevel.Debug, "{p1} {p2}")]
21[LoggerMessage(2, LogLevel.Debug, "{helper}")]
41M11(logger, "A", LogLevel.Debug, "B");
45[LoggerMessage(0, LogLevel.Critical, "Message1")]
49[LoggerMessage(1, LogLevel.Critical, "Message2")]
53[LoggerMessage(2, LogLevel.Critical, "Message3")]
57[LoggerMessage(3, LogLevel.Critical, "Message4")]
61[LoggerMessage(4, LogLevel.Critical, "Message5 {items}")]
65[LoggerMessage(5, LogLevel.Critical, "Message6\n\"\r")]
69[LoggerMessage(6, LogLevel.Critical, "Message7 {p1}\n\"\r")]
73[LoggerMessage(7, LogLevel.Critical, "Message8")]
77[LoggerMessage(8, LogLevel.Critical, "Message9")]
81[LoggerMessage(9, LogLevel.Critical, "Message10 {optional}")]
86internal static partial void M11(ILogger logger, string p1, LogLevel level, string p2);
test\Generators\Microsoft.Gen.Logging\TestClasses\TagProviderExtensions.cs (8)
14[LoggerMessage(int.MaxValue, LogLevel.Warning, "Custom provided properties for {Param}.")]
19[LoggerMessage(LogLevel.Debug, "Custom provided properties for struct.")]
24[LoggerMessage(LogLevel.Information, "Custom provided properties for interface.")]
29[LoggerMessage(int.MinValue, LogLevel.Warning, "Custom provided properties for both complex params and {StringParam}.")]
36[LoggerMessage(1, LogLevel.Warning, "No params.")]
45LogLevel level,
51LogLevel level,
57LogLevel level,
Microsoft.Maui (2)
MiddlewareAnalysisSample (1)
OrderProcessor (1)
Redis (1)
RequestDecompressionSample (1)
ResponseCompressionSample (1)
RoutingSandbox (1)
RoutingWebSite (1)
ServerComparison.FunctionalTests (7)
ServerComparison.TestSites (1)
SignalR.Client.FunctionalTestApp (1)
SignalRSamples (1)
SocialWeather (1)
Sockets.BindTests (15)
Sockets.FunctionalTests (17)
StaticFileSample (1)
Stress.ApiService (1)
Stress.TelemetryService (1)
Templates.Blazor.Tests (3)
Templates.Blazor.WebAssembly.Auth.Tests (3)
Templates.Blazor.WebAssembly.Tests (3)
Templates.Mvc.Tests (3)
Templates.Tests (3)
TestProject.AppHost (3)
TestProject.WorkerA (1)
WsFedSample (2)