|
@@ -29,23 +29,27 @@ public class WebHttpSessionListener implements HttpSessionListener {
|
|
|
|
|
|
@Override
|
|
|
public void sessionCreated(HttpSessionEvent httpSessionEvent) {
|
|
|
+ String currSysTime = ItsUtils.getSysTime();
|
|
|
HttpSession session = httpSessionEvent.getSession();
|
|
|
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (session != null) {
|
|
|
+ session.setMaxInactiveInterval(WebConstants.MAX_INACTIVE_SESSION_TIMEOUT);
|
|
|
+
|
|
|
String creationTime = sdfDate.format(new Date(session.getCreationTime()));
|
|
|
String lastAccessTime = sdfDate.format(new Date(session.getLastAccessedTime()));
|
|
|
UserInfrVo userInfr = (UserInfrVo) session.getAttribute(WebConstants.LOGIN_USER);
|
|
|
if (userInfr != null) {
|
|
|
- session.setMaxInactiveInterval(WebConstants.MAX_INACTIVE_SESSION_TIMEOUT);
|
|
|
- log.info("Session Created: User: {}, {}", userInfr.getUserId(), userInfr.getOperSystId());
|
|
|
+ log.info("Session[{}] [{}], Created: [{}, {}] User: {}, {}", session.getId(), currSysTime, creationTime, lastAccessTime, userInfr.getUserId(), userInfr.getOperSystId());
|
|
|
}
|
|
|
- log.info("Session Created: {}, {}, {}", creationTime, lastAccessTime, session.getMaxInactiveInterval());
|
|
|
+ log.info("Session[{}] [{}], Created: [{}, {}] User Not Found: {}", session.getId(), currSysTime, creationTime, lastAccessTime, session.getMaxInactiveInterval());
|
|
|
+ } else {
|
|
|
+ log.info("Session[NULL] [{}], Created: Not Found Session.", currSysTime);
|
|
|
}
|
|
|
- log.info("Session Created: {}", httpSessionEvent.getSession().getMaxInactiveInterval());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
|
|
|
+ String currSysTime = ItsUtils.getSysTime();
|
|
|
HttpSession session = httpSessionEvent.getSession();
|
|
|
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
if (session != null) {
|
|
@@ -60,16 +64,20 @@ public class WebHttpSessionListener implements HttpSessionListener {
|
|
|
.build();
|
|
|
this.service.logout(req);
|
|
|
userInfr.setLogoutHms(ItsUtils.getSysTime());
|
|
|
- log.info("logout history: {}", req);
|
|
|
+ log.info("Session[{}] [{}], Destroyed: [{}, {}] User: {}, {}, {}, {}, Logout History: {}",
|
|
|
+ session.getId(), currSysTime, creationTime, lastAccessTime, userInfr.getUserId(), userInfr.getOperSystId(), userInfr.getLoginHms(), userInfr.getLogoutHms(), req);
|
|
|
+ } else {
|
|
|
+ log.info("Session[{}] [{}], Destroyed: [{}, {}] User: {}, {}, {}, {}, Logout History Already Save.",
|
|
|
+ session.getId(), currSysTime, creationTime, lastAccessTime, userInfr.getUserId(), userInfr.getOperSystId(), userInfr.getLoginHms(), userInfr.getLogoutHms());
|
|
|
}
|
|
|
- log.info("Session Destroyed: User: {}, {}, {}, {}", userInfr.getUserId(), userInfr.getOperSystId(), userInfr.getLoginHms(), userInfr.getLogoutHms());
|
|
|
}
|
|
|
else {
|
|
|
- log.info("Session Destroyed: {}, {}, {}", creationTime, lastAccessTime, session.getMaxInactiveInterval());
|
|
|
+ log.info("Session[{}] [{}], Destroyed: [{}, {}] User Not Found: {}",
|
|
|
+ session.getId(), currSysTime, creationTime, lastAccessTime, session.getMaxInactiveInterval());
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- log.info("Session Destroyed: {}", httpSessionEvent);
|
|
|
+ log.info("Session[NULL] [{}], Destroyed: Not Found Session.", currSysTime);
|
|
|
}
|
|
|
}
|
|
|
|