Add container session ID and user-agent IP address to logging MDC - SIDP-441
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 14 Mar 2011 14:40:24 +0000 (14:40 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 14 Mar 2011 14:40:24 +0000 (14:40 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/branches/REL_2@2995 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

doc/RELEASE-NOTES.txt
pom.xml
src/main/java/edu/internet2/middleware/shibboleth/idp/session/IdPSessionFilter.java

index 139fe94..85ff0d4 100644 (file)
@@ -3,6 +3,7 @@ Changes in Release 2.3.0
 [SIDP-272] - Regenerate self-signed certificate with installer task
 [SIDP-404] - Add an install-time setting for the path to web.xml
 [SIDP-429] - Limit metadata SP credential resolution for encryption to RSA keys only
+[SIDP-442] - Add JSESSIONID and ClientIP to MDC
 [SIDP-461] - Add legacy Shib SSO protocol as binding for IdP-initiated SSO for SAML 2.0
 [SIDP-464] - An SPNameQualifier in NameIDPolicy always treated as an affiliation
 [SIDP-468] - Add taglib to simplify rendering login pages. 
diff --git a/pom.xml b/pom.xml
index 0548626..58bb6f5 100644 (file)
--- a/pom.xml
+++ b/pom.xml
             <artifactId>servlet-api</artifactId>
             <version>2.4</version>
         </dependency>
-        
         <dependency>
             <groupId>javax.servlet.jsp</groupId>
             <artifactId>jsp-api</artifactId>
             <version>2.0</version>
         </dependency>
-
                 
         <!-- Runtime dependencies -->
         <dependency>
index 3db360a..5f0708b 100644 (file)
@@ -64,6 +64,9 @@ public class IdPSessionFilter implements Filter {
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException,
             ServletException {
         HttpServletRequest httpRequest = (HttpServletRequest) request;
+        
+        MDC.put("JSESSIONID", httpRequest.getSession().getId());
+        MDC.put("clientIP", httpRequest.getRemoteAddr());
 
         Cookie sessionCookie = getIdPSessionCookie(httpRequest);
         Session idpSession = getUserSession(sessionCookie, httpRequest);