Skip to content

Commit

Permalink
Add request logging & add logs to gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Feb 24, 2024
1 parent 6cad9cc commit 5f705e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ obj/
/packages/
riderModule.iml
/_ReSharper.Caches/
*/appsettings.Secret.json
*/appsettings.Secret.json
logs/
7 changes: 7 additions & 0 deletions Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Http.Features;
using Microsoft.EntityFrameworkCore;
using Serilog;
using Serilog.AspNetCore;
using Server;
using Server.Api;

Expand Down Expand Up @@ -52,6 +53,12 @@
});
});

// Endpoint logging
builder.Services.Configure<RequestLoggingOptions>(options =>
{
options.MessageTemplate = "Handled {RequestPath}";
});

builder.Services.AddMvc();
var app = builder.Build();

Expand Down

0 comments on commit 5f705e9

Please sign in to comment.