diff --git a/src/TestApplication/Program.cs b/src/TestApplication/Program.cs index 184112d..bebc089 100644 --- a/src/TestApplication/Program.cs +++ b/src/TestApplication/Program.cs @@ -1,4 +1,5 @@ using Serilog; +using Serilog.Context; using Serilog.Debugging; var builder = WebApplication.CreateBuilder(args); @@ -11,6 +12,7 @@ var serilogSection = context.Configuration.GetSection("Serilog"); config.ReadFrom.Configuration(context.Configuration); + config.Enrich.FromLogContext(); }); var app = builder.Build(); @@ -31,7 +33,9 @@ app.MapGet("/weatherforecast", () => { var seriloglogger = Log.ForContext(); - + LogContext.PushProperty("TestProperty", "TestPropertyValue"); + seriloglogger.Information("SomeTestInfo"); + var forecast = Enumerable.Range(1, 5).Select(index => new WeatherForecast (