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 ba39700 commit da7a78f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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.Debug))
if (!logger.IsEnabled(LogLevel.Information))
{
await next();
return;
Expand All @@ -32,11 +32,11 @@ public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionE

var stopwatch = new Stopwatch();
stopwatch.Start();
logger.LogDebug("Request starting {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {ContentType} {ContentLength}",
logger.LogInformation("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.LogDebug("Request finished {Protocol} {Method} {Scheme}://{Host}{PathBase}{Path}{QueryString} - {StatusCode} {ContentLength} {ContentType} {ElapsedMilliseconds}ms",
logger.LogInformation("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
3 changes: 2 additions & 1 deletion back/src/Liane/Liane.Web/default.Production.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"LogLevel": {
"Default": "Information",
"System": "Warning",
"Microsoft": "Error"
"Microsoft": "Error",
"Liane.Web.Internal.Debug": "Information"
}
},
"Mongo": {
Expand Down

0 comments on commit da7a78f

Please sign in to comment.