From aa2380e090368b42d3543bffb7e4e1e056eb7938 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Fri, 15 Jul 2022 19:15:05 +0800 Subject: [PATCH] Update HttpSessionListenerAdapter.java --- .../org/maxkey/authn/web/HttpSessionListenerAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java index cc84d5397..599039d36 100644 --- a/maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java +++ b/maxkey-authentications/maxkey-authentication-core/src/main/java/org/maxkey/authn/web/HttpSessionListenerAdapter.java @@ -54,13 +54,17 @@ public class HttpSessionListenerAdapter implements HttpSessionListener { HttpSession session = sessionEvent.getSession(); Authentication authentication = (Authentication ) session.getAttribute(WebConstants.AUTHENTICATION); SignPrincipal principal = AuthorizationUtils.getPrincipal(authentication); - if(principal != null ) { - _logger.trace("{} HttpSession Id {} for userId {} , username {} @Ticket {} Destroyed" , + if(principal != null && principal.getUserInfo() !=null) { + _logger.debug("{} HttpSession Id {} for userId {} , username {} @Ticket {} Destroyed" , DateUtils.formatDateTime(new Date()), session.getId(), principal.getUserInfo().getId(), principal.getUserInfo().getUsername(), principal.getSession().getId()); + }else { + _logger.trace("{} HttpSession Id {} Destroyed" , + DateUtils.formatDateTime(new Date()), + session.getId()); } }