I have aspnetcore2 api that is using IdentityServer4.AccessTokenValidation
and Microsoft.AspNetCore.Authentication.JwtBearer
packes to handle access token authentication.
I've setup Serilog logging in my application with the following config:
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("System", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Warning)
.WriteTo.Logger(l => l.MinimumLevel.Verbose().WriteTo.Console())
.WriteTo.Logger(l => l.MinimumLevel.Information().WriteTo.File("logs/logfile.log",
rollingInterval: RollingInterval.Day, retainedFileCountLimit: 10))
.CreateLogger();
I was able to Override log levels for System
and Microsoft
log sources.
However I still receive the following log entry in my log file:
2018-05-23 20:30:27.228 -04:00 [INF] AuthenticationScheme: Bearer was successfully authenticated.
I can't seem to figureout the log source for Microsoft.AspNetCore.Authentication.JwtBearer
so I can filter them out like I did System
and Microsoft
.