From 59d8668dedb16c96bec7eb78dfa4a0fc0aa6459f Mon Sep 17 00:00:00 2001 From: Adam Gertenbach Date: Mon, 11 Dec 2023 10:02:27 -0500 Subject: [PATCH] 1.0.1 - update target frameworks and readme --- .../LogDeferred.WebApplicationBuilder.csproj | 2 +- LogDeferred.WebApplicationBuilder/readme.md | 4 ++- LogDeferred/LogDeferred.csproj | 27 ++++++++++++++++--- LogDeferred/readme.md | 4 ++- readme.md | 4 ++- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/LogDeferred.WebApplicationBuilder/LogDeferred.WebApplicationBuilder.csproj b/LogDeferred.WebApplicationBuilder/LogDeferred.WebApplicationBuilder.csproj index 1f3b1eb..8af7568 100644 --- a/LogDeferred.WebApplicationBuilder/LogDeferred.WebApplicationBuilder.csproj +++ b/LogDeferred.WebApplicationBuilder/LogDeferred.WebApplicationBuilder.csproj @@ -1,7 +1,7 @@  - 1.0.0 + 1.0.1 Adam Gertenbach LogDeferred.WebApplicationBuilder Enables deferred logging against the WebApplicationBuilder during services registration using familiar ILogger abstractions plus dependency injection diff --git a/LogDeferred.WebApplicationBuilder/readme.md b/LogDeferred.WebApplicationBuilder/readme.md index 5086169..62ee20c 100644 --- a/LogDeferred.WebApplicationBuilder/readme.md +++ b/LogDeferred.WebApplicationBuilder/readme.md @@ -101,7 +101,7 @@ With the deferred logging available from the start, I can get a better picture o Feature One is enabled info: MyApplication.Services.DatabaseProvider[0] Database provider is Local - info: MyApplication.Services.FeatureOne[0] + warn: MyApplication.Services.FeatureOne[0] Feature one doesn't have a valid connection string! info: MyApplication.Services.DatabaseProvider[0] Here is other useful DatabaseProvider information @@ -160,6 +160,8 @@ For example: will result in the log `Mode is 2` because both calls to `Configure` occur before the host starts and the value is computed. +If the host fails to start, deferred logs will not be produced. If you must ensure that logs are recorded regarding the starting of the host, you should still consider bootstrapping a logger for immediate access. + ### Customizing the default startup logger name Since the extensions are running against the `IServiceCollection` directly, we must specify a default logger category for any log events if a type parameter is not supplied. To keep the naming approximately consistent with other logging occurring as the host starts, we opted for "Microsoft.Hosting.Startup". diff --git a/LogDeferred/LogDeferred.csproj b/LogDeferred/LogDeferred.csproj index f109ee4..e367c82 100644 --- a/LogDeferred/LogDeferred.csproj +++ b/LogDeferred/LogDeferred.csproj @@ -1,7 +1,7 @@  - 1.0.0 + 1.0.1 Adam Gertenbach LogDeferred Enables deferred logging against the IServiceCollection during services registration using familiar ILogger abstractions plus dependency injection @@ -11,7 +11,7 @@ LogDeferred true true - netstandard2.1 + netstandard2.1;net6.0;net7.0;net8.0 https://github.com/agertenbach/LogDeferred https://github.com/agertenbach/LogDeferred ILogger Startup Logging Registration IServiceCollection @@ -20,13 +20,34 @@ enable - + + + + + + + + + + + + + + + + + + + + + + diff --git a/LogDeferred/readme.md b/LogDeferred/readme.md index 5086169..62ee20c 100644 --- a/LogDeferred/readme.md +++ b/LogDeferred/readme.md @@ -101,7 +101,7 @@ With the deferred logging available from the start, I can get a better picture o Feature One is enabled info: MyApplication.Services.DatabaseProvider[0] Database provider is Local - info: MyApplication.Services.FeatureOne[0] + warn: MyApplication.Services.FeatureOne[0] Feature one doesn't have a valid connection string! info: MyApplication.Services.DatabaseProvider[0] Here is other useful DatabaseProvider information @@ -160,6 +160,8 @@ For example: will result in the log `Mode is 2` because both calls to `Configure` occur before the host starts and the value is computed. +If the host fails to start, deferred logs will not be produced. If you must ensure that logs are recorded regarding the starting of the host, you should still consider bootstrapping a logger for immediate access. + ### Customizing the default startup logger name Since the extensions are running against the `IServiceCollection` directly, we must specify a default logger category for any log events if a type parameter is not supplied. To keep the naming approximately consistent with other logging occurring as the host starts, we opted for "Microsoft.Hosting.Startup". diff --git a/readme.md b/readme.md index 5086169..62ee20c 100644 --- a/readme.md +++ b/readme.md @@ -101,7 +101,7 @@ With the deferred logging available from the start, I can get a better picture o Feature One is enabled info: MyApplication.Services.DatabaseProvider[0] Database provider is Local - info: MyApplication.Services.FeatureOne[0] + warn: MyApplication.Services.FeatureOne[0] Feature one doesn't have a valid connection string! info: MyApplication.Services.DatabaseProvider[0] Here is other useful DatabaseProvider information @@ -160,6 +160,8 @@ For example: will result in the log `Mode is 2` because both calls to `Configure` occur before the host starts and the value is computed. +If the host fails to start, deferred logs will not be produced. If you must ensure that logs are recorded regarding the starting of the host, you should still consider bootstrapping a logger for immediate access. + ### Customizing the default startup logger name Since the extensions are running against the `IServiceCollection` directly, we must specify a default logger category for any log events if a type parameter is not supplied. To keep the naming approximately consistent with other logging occurring as the host starts, we opted for "Microsoft.Hosting.Startup".