mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
More server logging
This commit is contained in:
parent
099afa3e2e
commit
f21b4569a2
@ -58,6 +58,7 @@ public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthentic
|
||||
var metricsKey = Request.Headers[_settings.MetricsKeyHeader].FirstOrDefault();
|
||||
// Never needed this, disabled for now
|
||||
//await LogRequest(metricsKey);
|
||||
var ip = Request.HttpContext.Connection.RemoteIpAddress?.ToString() ?? "";
|
||||
if (metricsKey != default)
|
||||
{
|
||||
if (await _tarLog.Contains(metricsKey))
|
||||
@ -67,7 +68,8 @@ public class ApiKeyAuthenticationHandler : AuthenticationHandler<ApiKeyAuthentic
|
||||
Subject = metricsKey,
|
||||
Action = "tarlog",
|
||||
MetricsKey = metricsKey,
|
||||
UserAgent = Request.Headers.UserAgent
|
||||
UserAgent = Request.Headers.UserAgent,
|
||||
Ip = ip
|
||||
});
|
||||
await Task.Delay(TimeSpan.FromSeconds(20));
|
||||
throw new Exception("Error, lipsum timeout of the cross distant cloud.");
|
||||
|
@ -79,6 +79,7 @@ public class MetricsController : ControllerBase
|
||||
Subject = value,
|
||||
MetricsKey = metricsKey,
|
||||
UserAgent = Request.Headers.UserAgent.FirstOrDefault() ?? "<unknown>",
|
||||
Ip = Request.HttpContext.Connection.RemoteIpAddress?.ToString() ?? ""
|
||||
});
|
||||
return new Result {Timestamp = date};
|
||||
}
|
||||
|
@ -10,4 +10,5 @@ public class Metric
|
||||
public string Subject { get; set; }
|
||||
public string MetricsKey { get; set; }
|
||||
public string UserAgent { get; set; }
|
||||
public string Ip { get; set; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user