Show TOC

LoggingLocate this document in the navigation structure

The HTTP Output adapter uses the Apache log4j API to log errors, warnings, and information and debugging messages. A sample log4j.properties file containing the logging configuration is part of the HTTP Output adapter distribution.

You can modify the logging levels of the log4j.properties configuration file which is located in the %STREAMING_HOME%\adapters\<adapter-name>\config directory. Set the ADAPTER_CLASSPATH environment variable to point to the configuration directory of each adapter for which you are configuring logging.

The logging levels in log4j.properties are:
Level Description
OFF Logs no events.
FATAL Logs severe errors that prevent the application from continuing.
ERROR Logs potentially recoverable application errors.
WARN Logs events that possibly lead to errors.
INFO Logs events for informational purposes.
DEBUG Logs general debugging events.
TRACE Logs fine-grained debug messages that capture the flow of the application.
ALL Logs all events.
Note Setting the log level to DEBUG or ALL may result in large log files. The default value is INFO.
Here is a sample log4j.properties file:
# Set root logger level to INFO and set appenders to stdout, file and email
log4j.rootLogger=INFO, stdout, R

# stdout appender
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{MM-dd-yyyy HH:mm:ss.SSS} %p [%t] (%C{1}.%M) %m%n
log4j.appender.stdout.Threshold=INFO

# file appender
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=logs/adapter.log
log4j.appender.R.DatePattern='.'yyyy-MM-dd
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{MM-dd-yyyy HH:mm:ss.SSS} %p [%t] (%C{1}.%M) %m%n
log4j.appender.R.Threshold=INFO

# email appender
log4j.appender.email=org.apache.log4j.net.SMTPAppender
log4j.appender.email.To=your.name@yourcompany.com
log4j.appender.email.From=alert.manager@yourcompany.com
log4j.appender.email.SMTPHost=yourmailhost
log4j.appender.email.BufferSize=1
log4j.appender.email.Subject=Adapter Error
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.layout.ConversionPattern=%d{MM-dd-yyyy HH:mm:ss.SSS} %p [%t] (%C{1}.%M) %m%n
log4j.appender.email.Threshold=ERROR

log4j.logger.com.sybase.esp=INFO

The log4j.rootLogger option sets the default log behavior for all the sub-loggers in the adapter. In addition to the root logger, the adapter contains various sub-loggers that control logging for specific adapter functions.

Setting the log4j.rootLogger to any value more verbose than INFO may produce excess information. If you explicitly set the log level for a sub-logger, you overwrite the default setting for that particular logger. In this way, you can make sub-loggers more verbose than the default. The names for Event Stream Processor related loggers contain the string com.sybase.esp.