Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Волков Антон Александрович committed Jun 16, 2023
1 parent 590183d commit 4a9ba0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/TestApplication/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Serilog;
using Serilog.Context;
using Serilog.Debugging;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -11,6 +12,7 @@

var serilogSection = context.Configuration.GetSection("Serilog");
config.ReadFrom.Configuration(context.Configuration);
config.Enrich.FromLogContext();
});

var app = builder.Build();
Expand All @@ -31,7 +33,9 @@
app.MapGet("/weatherforecast", () =>
{
var seriloglogger = Log.ForContext<Program>();

LogContext.PushProperty("TestProperty", "TestPropertyValue");
seriloglogger.Information("SomeTestInfo");

var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
Expand Down

0 comments on commit 4a9ba0f

Please sign in to comment.