diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2017-11-29 15:02:12 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2017-11-29 15:02:20 +0100 |
commit | 450e951718633ec57fcae7a2449f6db23a527545 (patch) | |
tree | 934fe92e9aefec7d4a2e9c9db3956bfd7d6f8d5b /container-accesslogging | |
parent | a0e14655026e65e60373da4eaf728e43f75ebf38 (diff) |
Add ssl principal to json access log
Diffstat (limited to 'container-accesslogging')
-rw-r--r-- | container-accesslogging/src/main/java/com/yahoo/container/logging/JSONFormatter.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/container-accesslogging/src/main/java/com/yahoo/container/logging/JSONFormatter.java b/container-accesslogging/src/main/java/com/yahoo/container/logging/JSONFormatter.java index 2e97dff775b..a8be7c5ed13 100644 --- a/container-accesslogging/src/main/java/com/yahoo/container/logging/JSONFormatter.java +++ b/container-accesslogging/src/main/java/com/yahoo/container/logging/JSONFormatter.java @@ -68,6 +68,11 @@ public class JSONFormatter { generator.writeStringField("user-principal", principal.getName()); } + Principal sslPrincipal = accessLogEntry.getSslPrincipal(); + if (sslPrincipal != null) { + generator.writeStringField("ssl-principal", principal.getName()); + } + // Only add remote address/port fields if relevant if (remoteAddressDiffers(accessLogEntry.getIpV4Address(), accessLogEntry.getRemoteAddress())) { generator.writeStringField("remoteaddr", accessLogEntry.getRemoteAddress()); |