Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
HaikAsatryan committed Aug 26, 2024
1 parent 267adc7 commit cf8f794
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Pandatech.ModularMonolith.ApiGateway/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

app.UseStaticFiles();

app.UseResponseCrafter()
app
.UseRequestResponseLogging()
.UseResponseCrafter()
.UseCors()
.UseModules()
.EnsureHealthy()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
using Pandatech.ModularMonolith.SharedKernel.Middlewares;

namespace Pandatech.ModularMonolith.SharedKernel.Extensions;

public static class LoggingExtensions
{
public static WebApplication UseRequestResponseLogging(this WebApplication app)
{
if (app.Logger.IsEnabled(LogLevel.Information))
{
app.UseMiddleware<RequestResponseLoggingMiddleware>();
}

return app;
}
}

0 comments on commit cf8f794

Please sign in to comment.