Skip to content

Commit ce83465

Browse files
committed
Add hub id to log
1 parent 168e573 commit ce83465

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

Common/Authentication/AuthorizationHandlers/ApiTokenPermissionHandler.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

Common/Utils/OpenShockEnricher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
3232
logEvent.AddOrUpdateProperty(new LogEventProperty("RequestHost", new ScalarValue(ctx.Request.Headers[HeaderNames.Host].FirstOrDefault())));
3333
logEvent.AddOrUpdateProperty(new LogEventProperty("RequestReferer", new ScalarValue(ctx.Request.Headers[HeaderNames.Referer].FirstOrDefault())));
3434
logEvent.AddOrUpdateProperty(new LogEventProperty("CF-IPCountry", new ScalarValue(ctx.GetCFIPCountry())));
35-
36-
//logEvent.AddOrUpdateProperty(new LogEventProperty("Headers", new DictionaryValue(ctx.Request.Headers.Select(x => new KeyValuePair<ScalarValue, LogEventPropertyValue>(new ScalarValue(x.Key), new ScalarValue(x.Value))))));
37-
35+
3836
foreach (var claim in ctx.User.Claims)
3937
{
4038
switch (claim.Type)
@@ -45,7 +43,9 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
4543
case OpenShockAuthClaims.ApiTokenId:
4644
AddVar(logEvent, "ApiToken", claim.Value);
4745
break;
48-
46+
case OpenShockAuthClaims.HubId:
47+
AddVar(logEvent, "Hub", claim.Value);
48+
break;
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)