From 722d9b828ccc70aeeae2d89c5bc655f4e62b6cc6 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 25 Sep 2018 17:04:38 +0200 Subject: [PATCH] Log sec-org header --- .../georchestra/cadastrapp/providers/PreRequestFilter.java | 4 +++- cadastrapp/src/main/resources/logback.xml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cadastrapp/src/main/java/org/georchestra/cadastrapp/providers/PreRequestFilter.java b/cadastrapp/src/main/java/org/georchestra/cadastrapp/providers/PreRequestFilter.java index 992aa7f1..b98d3dec 100644 --- a/cadastrapp/src/main/java/org/georchestra/cadastrapp/providers/PreRequestFilter.java +++ b/cadastrapp/src/main/java/org/georchestra/cadastrapp/providers/PreRequestFilter.java @@ -22,8 +22,10 @@ public class PreRequestFilter implements ContainerRequestFilter { public void filter(ContainerRequestContext requestContext) throws IOException { String rolesList = requestContext.getHeaderString("sec-roles"); + String org = requestContext.getHeaderString("sec-org"); String userName = requestContext.getHeaderString("sec-username"); MDC.put("user", userName); + MDC.put("org", org); MDC.put("roles", rolesList); MDC.put("uri", requestContext.getUriInfo().getPath()); @@ -34,4 +36,4 @@ public void filter(ContainerRequestContext requestContext) throws IOException { } } -} \ No newline at end of file +} diff --git a/cadastrapp/src/main/resources/logback.xml b/cadastrapp/src/main/resources/logback.xml index 72cb3668..731e9f71 100644 --- a/cadastrapp/src/main/resources/logback.xml +++ b/cadastrapp/src/main/resources/logback.xml @@ -30,7 +30,7 @@ /tmp/cadastrapp.log - %d [%thread] %-5level /%X{uri} - %X{user:-nouser} - %X{roles:-norole} -%logger{36} - %msg%n + %d [%thread] %-5level /%X{uri} - %X{user:-nouser} - %X{org:-noorg} - %X{roles:-norole} -%logger{36} - %msg%n @@ -38,4 +38,4 @@ - \ No newline at end of file +