Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created May 12, 2021 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/b13f202590ff8ebdea545600b24cb2b6 to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/b13f202590ff8ebdea545600b24cb2b6 to your computer and use it in GitHub Desktop.
.NET Applications and Logging Configurations in appsettings.json
{
"Logging": {
"LogLevel": { // No provider, LogLevel applies to all the enabled providers.
"Default": "Error", // Default, application level if no other level applies
"Microsoft": "Warning", // Log level for log category which starts with text 'Microsoft' (i.e. 'Microsoft.*')
"Microsoft.Hosting.Lifetime": "Warning"
},
"Debug": { // Debug logging provider.
"LogLevel": {
"Default": "Information" // Overrides preceding LogLevel:Default setting.
}
},
"Console": { // Debug console provider.
"IncludeScopes": true,
"LogLevel": {
"Microsoft.AspNetCore.Mvc.Razor.Internal": "Warning",
"Microsoft.AspNetCore.Mvc.Razor.Razor": "Debug",
"Microsoft.AspNetCore.Mvc.Razor": "Error",
"Default": "Information"
}
},
"EventSource": { // Event source provider
"LogLevel": {
"Microsoft": "Information"
}
},
"EventLog": { // Event log provider
"LogLevel": {
"Microsoft": "Information"
}
},
"AzureAppServicesFile": { // Azure App Service File Provider
"IncludeScopes": true,
"LogLevel": {
"Default": "Warning"
}
},
"AzureAppServicesBlob": { // Azure App Service Blog provider
"IncludeScopes": true,
"LogLevel": {
"Microsoft": "Information"
}
},
"ApplicationInsights": { // Azure ApplicationInsights provider
"LogLevel": {
"Default": "Information"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment