Added new parameter in log "Origin"
This commit is contained in:
parent
669500e57e
commit
ff722503d5
@ -24,7 +24,7 @@ namespace MarcoBMS.Services.Middleware
|
||||
var response = context.Response;
|
||||
var request = context.Request;
|
||||
var tenantId = context.User.FindFirst("TenantId")?.Value;
|
||||
|
||||
string origin = request.Headers["Origin"].FirstOrDefault() ?? "";
|
||||
|
||||
using (LogContext.PushProperty("TenantId", tenantId))
|
||||
using (LogContext.PushProperty("TraceId", context.TraceIdentifier))
|
||||
@ -33,6 +33,8 @@ namespace MarcoBMS.Services.Middleware
|
||||
using (LogContext.PushProperty("Timestamp", DateTime.UtcNow))
|
||||
using (LogContext.PushProperty("IpAddress", context.Connection.RemoteIpAddress?.ToString()))
|
||||
using (LogContext.PushProperty("RequestPath", request.Path))
|
||||
using (LogContext.PushProperty("Origin", origin))
|
||||
|
||||
|
||||
|
||||
try
|
||||
|
@ -218,7 +218,7 @@ namespace MarcoBMS.Services.Service
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Token is invalid
|
||||
Console.WriteLine($"Token validation failed: {ex.Message}");
|
||||
_logger.LogError($"Token validation failed: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user