mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-10 01:49:03 +02:00
Add HttpLogging
This commit is contained in:
parent
29cd0c20d8
commit
dbfde5c70e
@ -1,6 +1,7 @@
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.HttpLogging;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Newtonsoft.Json;
|
||||
@ -49,6 +50,12 @@ if (useRedis)
|
||||
services.AddSingleton(cx.GetDatabase());
|
||||
}
|
||||
|
||||
services.AddHttpLogging((o) =>
|
||||
{
|
||||
o.LoggingFields = HttpLoggingFields.All;
|
||||
o.RequestBodyLogLimit = 4096;
|
||||
o.ResponseBodyLogLimit = 4096;
|
||||
});
|
||||
services.AddHttpClient();
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
@ -164,6 +171,7 @@ foreach (var migration in migrations)
|
||||
app.UseStaticFiles();
|
||||
#endif
|
||||
|
||||
app.UseHttpLogging();
|
||||
app.UseRouting();
|
||||
app.UseCors();
|
||||
app.UseSwagger();
|
||||
|
Loading…
x
Reference in New Issue
Block a user