Skip to content

Commit

Permalink
feat(back): add image profile route in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
agjini committed Aug 17, 2023
1 parent 67c0596 commit ba39700
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public RequestLoggerFilter(ILogger<RequestLoggerFilter> logger)

public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
if (!logger.IsEnabled(LogLevel.Information))
if (!logger.IsEnabled(LogLevel.Debug))
{
await next();
return;
Expand All @@ -32,11 +32,11 @@ public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionE

var stopwatch = new Stopwatch();
stopwatch.Start();
logger.LogInformation("Request starting {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {ContentType} {ContentLength}",
logger.LogDebug("Request starting {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {ContentType} {ContentLength}",
request.Protocol, request.Method, request.Scheme, request.Host, request.PathBase, request.Path, request.QueryString, request.ContentType ?? "-", request.ContentLength?.ToString(CultureInfo.InvariantCulture) ?? "-");
await next();
var response = context.HttpContext.Response;
logger.LogInformation("Request finished {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {StatusCode} {ContentLength} {ContentType} {ElapsedMilliseconds}ms",
logger.LogDebug("Request finished {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {StatusCode} {ContentLength} {ContentType} {ElapsedMilliseconds}ms",
request.Protocol, request.Method, request.Scheme, request.Host, request.PathBase, request.Path, request.QueryString,
response.StatusCode, response.ContentLength?.ToString(CultureInfo.InvariantCulture) ?? "-", response.ContentType ?? "-", stopwatch.ElapsedMilliseconds);
}
Expand Down

0 comments on commit ba39700

Please sign in to comment.