Sun Java System Instant Messaging 7 2006Q1 Administration Guide

Managing Logging for the XMPP/HTTP Gateway

You can configure the level of logging for the XMPP/HTTP Gateway, enable or disable logging entirely, and change the location of the gateway log file or the gateway log configuration file as described in the following sections:

More information about the log4j format supported by Instant Messaging's is described at the Apache Logging Services website.

ProcedureTo Enable or Disable Logging for the XMPP/HTTP Gateway

You can enable or disable logging for the gateway in two ways:

Under most circumstances, you should modify the configuration in the httpbind_log4j.conf file itself, leaving the httpbind.log4j.config parameter set to the location of the httpbind_log4j.conf file. This procedure describes modifying the configuration within the httpbind_log4j.conf file.

Steps
  1. Open the httpbind_log4j.conf file.

    This file is stored at the location you specified in httpbind.conf file as the value for thehttpbind.log4j.config parameter. By default the file is stored in the following directory under the default Instant Messaging instance:


    im_cfg_base/httpbind_log4j.conf
  2. To disable logging for the gateway, set the log4j.logger.gateway parameter as follows:


    log4j.logger.gateway=OFF
    
  3. To enable logging, set the log4j.logger.gateway parameter to the desired logging level.

    For example:


    log4j.logger.gateway=ERROR
    

    See Table 11–1 for a list of valid logging levels you can use.

  4. Save and close httpbind_log4j.conf.

ProcedureTo Change the Location of the XMPP/HTTP Gateway Log Configuration File

Steps
  1. Open httpbind.conf.

    See httpbind.conf File Location for information on finding this file.

  2. Set the value of the httpbind.log4j.config parameter to the location of the XMPP/HTTP Gateway log configuration file.

  3. Save and close httpbind.conf.

  4. Restart the gateway using the tools provided by the web or application server.

ProcedureTo Change the Location of the XMPP/HTTP Gateway Log File

Before You Begin

Ensure that you are familiar with the log4j syntax and general implementation described at the Apache Logging Services website.

Steps
  1. Open httpbind_log4j.conf.

    This file is stored at the location you specified in httpbind.conf file as the value for thehttpbind.log4j.config parameter. By default the file is stored in the following directory under the default Instant Messaging instance:


    im_cfg_base/httpbind_log4j.conf
  2. Set the value for the log4j.appender.appender_ID parameter to the location where you want to store the log file.

  3. Save and close httpbind_log4j.conf.

  4. Restart the web container.

ProcedureTo Set the XMPP/HTTP Gateway Logging Level

Before You Begin

Ensure that you are familiar with the log4j syntax and general implementation described at the Apache Logging Services website.

Steps
  1. Open httpbind_log4j.conf.

    This file is stored at the location you specified in httpbind.conf file as the value for thehttpbind.log4j.config parameter. By default the file is stored in the following directory under the default Instant Messaging instance:


    im_cfg_base/httpbind_log4j.conf
  2. Set the log4j.logger.gateway parameter to the desired logging level.

    For example:


    log4j.logger.gateway=ERROR
    

    See Table 11–1 for a list of valid logging levels you can use.

XMPP/HTTP Gateway log4j Log Configuration File Syntax

For more information about the log4j syntax and general implementation, see the Apache Logging Services website. The gateway log configuration file syntax is as follows.


log4j.logger.gateway=logging_level, Appender_ID
# DEFAULT TO RollingFileAppender
log4j.appender.Appender_ID=org.apache.log4j.RollingFileAppender
log4j.appender.Appender_ID.file=log_dir/httpbind.log
log4j.appender.Appender_ID.append=true|false
log4j.appender.Appender_ID.maxBackupIndex=7
log4j.appender.Appender_ID.maxFileSize=max_log_file_size
log4j.appender.Appender_ID.layout=org.apache.log4j.PatternLayout
log4j.appender.Appender_ID.layout.ConversionPattern=log_entry_syntax

Example 8–1 XMPP/HTTP Gateway Log Configuration File (httpbind_log4j.conf)


log4j.logger.gateway=ERROR, A1
# DEFAULT TO RollingFileAppender
log4j.appender.A1=org.apache.log4j.RollingFileAppender
# log4j.appender.A1.file=$(logdir)/gateway.log
log4j.appender.A1.file=/tmp/gatewaylog
log4j.appender.A1.append=true
log4j.appender.A1.maxBackupIndex=7
log4j.appender.A1.maxFileSize=5mb
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%d{DATE}] %-5p %c [%t] %m%n