Add more debug log in the SessionContextCache
@@ -54,6 +54,11 @@ public class SessionContextCache extends BaseCache<SessionContextCacheKey, Sessi
}
public void addToCache(SessionContextCacheKey key, SessionContextCacheEntry entry) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Adding session context corresponding to the key : " + key.getContextId() +
+ " with accessed time " + entry.getAccessedTime() + " and validity time " + entry.getValidityPeriod());
+ }
entry.setAccessedTime();
super.addToCache(key, entry);
Object authUser = entry.getContext().getProperty(FrameworkConstants.AUTHENTICATED_USER);
@@ -72,6 +77,10 @@ public class SessionContextCache extends BaseCache<SessionContextCacheKey, Sessi
// Retrieve session from the database if its not in cache
if (cacheEntry == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Session corresponding to the key : " + key.getContextId() + " cannot be found in the" +
+ " cache. Trying to get from db.");
+ }
cacheEntry = getSessionFromDB(key);
}
@@ -124,6 +133,10 @@ public class SessionContextCache extends BaseCache<SessionContextCacheKey, Sessi
SessionContextCacheEntry cacheEntry = super.getValueFromCache(key);
// Retrieve session from the database if it's not in the cache.
if (cacheEntry == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Session corresponding to the key : " + key.getContextId() + " cannot be found in the" +
+ " cache. Trying to get from cache.");
+ }
cacheEntry = getSessionFromDB(key);
}
@@ -162,12 +175,18 @@ public class SessionContextCache extends BaseCache<SessionContextCacheKey, Sessi
public void clearCacheEntry(SessionContextCacheKey key) {
+ if (log.isDebugEnabled()) {
+ log.debug("Clear session context corresponding to the key : " + key.getContextId());
+ }
super.clearCacheEntry(key);
SessionDataStore.getInstance().clearSessionData(key.getContextId(), SESSION_CONTEXT_CACHE_NAME);
}
public void clearCacheEntry(String sessionContextKey) {
+ if (log.isDebugEnabled()) {
+ log.debug("Clear session context corresponding to the key : " + sessionContextKey);
+ }
SessionContextCacheKey sessionContextCacheKey = new SessionContextCacheKey(sessionContextKey);
super.clearCacheEntry(sessionContextCacheKey);
SessionDataStore.getInstance().clearSessionData(sessionContextCacheKey.getContextId(),
