FileDocCategorySizeDatePackage
SessionLogger.javaAPI DocExample1133Thu Feb 12 13:33:06 GMT 2004com.jspservletcookbook

SessionLogger

public class SessionLogger extends Object implements HttpSessionListener

Fields Summary
private Logger
log
Constructors Summary
public SessionLogger()

  
      /*The loggers are typically initialized by a special initialization 
   listener or servlet.  If this is not the case, then initialize the
    logger here:
	
    java.util.ResourceBundle bundle =
    java.util.ResourceBundle.getBundle(
    "com.jspservletcookbook.global");
    PropertyConfigurator.configure(bundle.getString(
    "log-configure-path"));*/

  log = Logger.getLogger(SessionLogger.class);

  
Methods Summary
public voidsessionCreated(javax.servlet.http.HttpSessionEvent se)

    
    //log request of the INFO level
    log.info("HttpSession created: " + se.getSession().getId());
    
      
    
public voidsessionDestroyed(javax.servlet.http.HttpSessionEvent se)

    
    //log request about session's that are invalidated
    log.info("HttpSession invalidated: " + se.getSession().getId());