From 93deec8d4022aa63a8c47979b5ca6b7bbcbeeb29 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 16 Apr 2010 16:12:38 +0100 Subject: [PATCH] SEC-1458: Remove logger field in HttpSessionEventPublisher in favour of direct lookup. Prevents early initialization of logging system when listener is initialized. --- .../security/web/session/HttpSessionEventPublisher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java b/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java index 643043c342..5370da2ffc 100644 --- a/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java +++ b/web/src/main/java/org/springframework/security/web/session/HttpSessionEventPublisher.java @@ -44,7 +44,7 @@ import javax.servlet.http.HttpSessionListener; public class HttpSessionEventPublisher implements HttpSessionListener { //~ Static fields/initializers ===================================================================================== - private static final Log log = LogFactory.getLog(HttpSessionEventPublisher.class); + private static final String LOGGER_NAME = HttpSessionEventPublisher.class.getName(); //~ Methods ======================================================================================================== @@ -60,6 +60,7 @@ public class HttpSessionEventPublisher implements HttpSessionListener { */ public void sessionCreated(HttpSessionEvent event) { HttpSessionCreatedEvent e = new HttpSessionCreatedEvent(event.getSession()); + Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e); @@ -76,6 +77,7 @@ public class HttpSessionEventPublisher implements HttpSessionListener { */ public void sessionDestroyed(HttpSessionEvent event) { HttpSessionDestroyedEvent e = new HttpSessionDestroyedEvent(event.getSession()); + Log log = LogFactory.getLog(LOGGER_NAME); if (log.isDebugEnabled()) { log.debug("Publishing event: " + e);