Skip to content

Commit

Permalink
1.0.1 - update target frameworks and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Gertenbach committed Dec 11, 2023
1 parent 4be14b4 commit 59d8668
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Adam Gertenbach</Authors>
<Product>LogDeferred.WebApplicationBuilder</Product>
<Description>Enables deferred logging against the WebApplicationBuilder during services registration using familiar ILogger abstractions plus dependency injection</Description>
Expand Down
4 changes: 3 additions & 1 deletion LogDeferred.WebApplicationBuilder/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".

Expand Down
27 changes: 24 additions & 3 deletions LogDeferred/LogDeferred.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Adam Gertenbach</Authors>
<Product>LogDeferred</Product>
<Description>Enables deferred logging against the IServiceCollection during services registration using familiar ILogger abstractions plus dependency injection</Description>
Expand All @@ -11,7 +11,7 @@
<RootNamespace>LogDeferred</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<RepositoryUrl>https://github.com/agertenbach/LogDeferred</RepositoryUrl>
<PackageProjectUrl>https://github.com/agertenbach/LogDeferred</PackageProjectUrl>
<PackageTags>ILogger Startup Logging Registration IServiceCollection</PackageTags>
Expand All @@ -20,13 +20,34 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="readme.md" Pack="true" PackagePath="\"/>
<None Include="license.md" Pack="true" PackagePath="\"/>
Expand Down
4 changes: 3 additions & 1 deletion LogDeferred/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".

Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".

Expand Down

0 comments on commit 59d8668

Please sign in to comment.