From 4a9ba0f6720b5056e82da219b23ab5f818d268ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BE=D0=BB=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D1=82?= =?UTF-8?q?=D0=BE=D0=BD=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Fri, 16 Jun 2023 10:49:23 +0300 Subject: [PATCH] Check https://github.com/serilog-contrib/serilog-sinks-graylog/issues/74 --- src/TestApplication/Program.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 (