Skip to content

Commit

Permalink
Code(API::Serilog):Fixed logging by adding missing method registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
ktutak1337 committed Mar 12, 2024
1 parent 83c1e02 commit 34d27fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Server/StellarChat.Server.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using StellarChat.Shared.Infrastructure.Exceptions;
using StellarChat.Shared.Infrastructure.Contexts;
using StellarChat.Shared.Infrastructure.Observability.Logging;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -9,6 +10,7 @@
builder.Services.AddSwaggerGen();
builder.Services.AddErrorHandling();
builder.Services.AddContext();
builder.Host.UseLogging();

var app = builder.Build();

Expand All @@ -22,14 +24,16 @@
app.UseHttpsRedirection();
app.UseErrorHandling();
app.UseContext();
app.UseLogging();

var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

app.MapGet("/weatherforecast", () =>
app.MapGet("/weatherforecast", (ILogger<WeatherForecast> logger) =>
{
logger.LogInformation("test logginig");
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
Expand Down

0 comments on commit 34d27fb

Please sign in to comment.