Adapter Logging Configuration

Specific adapters currently available from SAP use the log4j API to log errors, warnings, and debugging messages.

Specify the location of the logging file you wish to use in the Log4jProperty parameter within the adapter configuration file. You can modify the logging levels within this file or the %ESP_HOME%\adapters\<adapter-name>\config\log4j.properties file, which is used by default. 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/rtviewadapter.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=RTView 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.