Created
February 13, 2024 22:58
-
-
Save graywolfcorp/78e9927b6204b49b7a5034c85c96a065 to your computer and use it in GitHub Desktop.
SeriLog config to exclude null messages from misc webjob actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log.Logger = new LoggerConfiguration() | |
.Enrich.FromLogContext() | |
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Warning) | |
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) | |
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning) | |
.WriteTo.Logger(x => x | |
.Filter.ByExcluding("StartsWith(@m, 'The next 5 occurrences')") | |
.Filter.ByExcluding("StartsWith(@m, 'Executing ''Functions')") | |
.Filter.ByExcluding("StartsWith(@m, 'Executed ''Functions')") | |
.Filter.ByExcluding("StartsWith(@m, 'null')") //suppress null messages from webjobs internal actions at INFO level https://github.com/Azure/azure-webjobs-sdk/issues/1968 | |
.MinimumLevel.Information() | |
.WriteTo.Console()) | |
.CreateLogger(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment