RequerstTrackerMiddleware. Add RequestLogDto.RequestContentLength

This commit is contained in:
ngfrolov 2023-06-20 12:35:21 +05:00
parent 8c401dfa9c
commit 1489c60675
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
2 changed files with 7 additions and 0 deletions

View File

@ -61,5 +61,10 @@ namespace AsbCloudApp.Data
/// стек вызовов
/// </summary>
public string? ExceptionStack { get; set; } = null!;
/// <summary>
/// Размер body
/// </summary>
public long? RequestContentLength { get; set; }
}
}

View File

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Org.BouncyCastle.Asn1.Ocsp;
using System.Threading.Tasks;
namespace AsbCloudWebApi.Middlewares
@ -23,6 +24,7 @@ namespace AsbCloudWebApi.Middlewares
UserIp = context.Connection?.RemoteIpAddress?.ToString(),
RequestMethod = context.Request.Method,
RequestPath = context.Request.Path.Value,
RequestContentLength = context.Request.ContentLength,
Referer = context.Request.Headers["Referer"].ToString(),
};
{