Skip to content

Commit

Permalink
fix: exception handling (#71)
Browse files Browse the repository at this point in the history
chnages:
- logger provider clearing added

closes #69
  • Loading branch information
BoBoBaSs84 authored Mar 19, 2024
2 parents 65bca83 + 6153f70 commit 3396fb7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
11 changes: 10 additions & 1 deletion src/DDS.Tools/Extensions/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ private static IServiceCollection RegisterLoggerService(this IServiceCollection

services.AddLogging(configure =>
{
configure.ClearProviders();
configure.AddEventLog(settings => settings.SourceName = environment.ApplicationName);
configure.SetMinimumLevel(LogLevel.Warning);

if (environment.IsDevelopment())
{
configure.SetMinimumLevel(LogLevel.Debug);
}
else
{
configure.SetMinimumLevel(LogLevel.Warning);
}
});

return services;
Expand Down
12 changes: 6 additions & 6 deletions src/DDS.Tools/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Logging": {
"LogLevel": {
"Default": "Information"
}
}
}
"Logging": {
"LogLevel": {
"Default": "Information"
}
}
}

0 comments on commit 3396fb7

Please sign in to comment.