Debugging the Chat Notification Servlet

The Chat Notification Servlet includes the Java logging package log4j. Several log points have been created to assist in debugging issues that might occur with this servlet.

The log4j.properties file is located in the Apache Tomcat webapps\<webapp>\WEB-INF\classes directory.

For example, following is the path:

C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\cns\WEB-INF\classes


C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\eschat\WEB-INF\classes

By default, the INFO level is set. If you want to turn on debugging, you can debug any or all of the following areas:

  • Memory Usage: Controlled by log4j.logger.MemoryLog
  • Session Counts: User and session IDs controlled by log4j.logger.SessionCount.
  • Session Inactivity Memory Cleanup: Controlled by log4j.logger.CacheCleanupCheck.
  • Session check and update requests: Controlled by log4j.logger.es.com.data.

To change debug parameters

  1. Open the log4j.properties file.
  2. Uncomment both lines of the required logger block (remove # symbols) and replace the INFO tag with DEBUG. The following example shows where INFO appears in the file:

    #log4j.rootLogger=INFO, stdout 
     
    #log4j.additivity.es.com.data=false 
    #log4j.logger.es.com.data=INFO, stdout 
     
    #log4j.additivity.CacheCleanupCheck=false 
    #log4j.logger.CacheCleanupCheck=INFO, stdout 
     
    #log4j.additivity.MemoryLog=false 
    #log4j.logger.MemoryLog=INFO, stdout 
     
    #log4j.additivity.SessionCount=false 
    #log4j.logger.SessionCount=INFO, stdout 
     
    #log4j.appender.stdout=org.apache.log4j.ConsoleAppender 
    #log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 
     
    # Pattern to output the caller's file name and line number. 
    log4j.appender.stdout.layout.ConversionPattern=%d\{ABSOLUTE\} %5p [%t] (%F:%L) - %m%n sid=<ChatSessionID>&uid=<UserID>
  3. Restart the web server that hosts this servlet.
    All debug information is logged to STDOUT. For Apache Tomcat, this is the STDOUT file in the logs folder.

    Note

    When you finish, be sure to turn debugging off, especially for memory and cache cleanup. Memory and cache are reported on regular intervals and quickly fill up the log and consume hard drive space.

Was this page helpful? Yes No Submitting... Thank you

Comments