Skip to content

Instantly share code, notes, and snippets.

@l-gu
Last active August 29, 2015 13:55
Show Gist options
  • Save l-gu/8784010 to your computer and use it in GitHub Desktop.
Save l-gu/8784010 to your computer and use it in GitHub Desktop.
@SuppressWarnings("unchecked")
protected void logSessionContent(HttpSession session) {
Enumeration<String> enumNames = session.getAttributeNames();
List<String> names = Collections.list(enumNames);
logger.info("Session content (size = " + names.size() + ") : ");
for ( String name : names ) {
logger.info(" . '" + name + "' : " + session.getAttribute(name) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment