Sun Java System Instant Messaging 7.2 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.

  1. Open the httpbind_log4j.conf file.

    This file is stored at the location you specified in httpbind.conf file as the value for the httpbind.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 13–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

  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.

ProcedureLinux: To Set the Location of the XMPP/HTTP Gateway Log File After Install or Upgrade

On Linux, after you install and configure the XMPP/HTTP Gateway, you need to modify the location of the default log file for the XMPP/HTTP gateway in httpbind_log4j.conf.

  1. Open the httpbind_log4j.conf file.

    This file is stored at the location you specified in httpbind.conf file as the value for the httpbind.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 of the log4.appender.appender_ID.file parameter to the location where log files are stored.

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.

  1. Open httpbind_log4j.conf.

    This file is stored at the location you specified in httpbind.conf file as the value for the httpbind.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 Use a Non-default Log File Location for the XMPP/HTTP Gateway

If you choose to use a location for logs other than the default, you need to modify the location of the default log file for the XMPP/HTTP gateway in httpbind_log4j.conf.

  1. Open the httpbind_log4j.conf file.

    This file is stored at the location you specified in httpbind.conf file as the value for the httpbind.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 of the log4.appender.appender_ID.file parameter to the location where log files are stored.

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.

  1. Open httpbind_log4j.conf.

    This file is stored at the location you specified in httpbind.conf file as the value for the httpbind.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 13–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 10–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