Skip to content

Commit

Permalink
test: update example to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer committed Sep 8, 2024
1 parent e086b65 commit 387f831
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
8 changes: 4 additions & 4 deletions examples/Serilog/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,9 +18,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Correlate.DependencyInjection" Version="4.0.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Correlate.DependencyInjection" Version="5.2.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="ReadLine" Version="2.0.1" />
</ItemGroup>

Expand Down
17 changes: 10 additions & 7 deletions examples/Serilog/Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.WebHost
.UseSerilog((ctx, loggerConfig) => loggerConfig
.ReadFrom.Configuration(ctx.Configuration)
.Enrich.FromLogContext()
// Add the property to the template explicitly, or log all properties with {Properties}.
.WriteTo.Console(outputTemplate: "Message: {Message:lj}{NewLine}\tCorrelation ID: {CorrelationId}{NewLine}")
.WriteTo.Debug()
builder.Services
.AddLogging(configure => configure.AddSerilog(
new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
.Enrich.FromLogContext()
// Add the property to the template explicitly, or log all properties with {Properties}.
.WriteTo.Console(outputTemplate: "Message: {Message:lj}{NewLine}\tCorrelation ID: {CorrelationId}{NewLine}")
.WriteTo.Debug()
.CreateLogger()
)
);

builder.Services
Expand Down
6 changes: 3 additions & 3 deletions examples/Serilog/Service/Service.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Correlate.AspNetCore" Version="4.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Correlate.AspNetCore" Version="5.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
</ItemGroup>


Expand Down

0 comments on commit 387f831

Please sign in to comment.