Logging

JReport provides a robust, flexible and configurable logging system which is based on log4j version 1.2.8, and supports versions from log4j version 1.2.8 to 1.3alpha7.

The logging system is used for obtaining meaningful and helpful JReport logging information in a convenient way. It is easy to configure and manage. The following are the significant benefits of the JReport logging system:

Configuring logs

Log configuration tasks can be achieved in two ways. They are:

Configuring output log appenders

JReport logging system provides certain appenders to which log content can be output and by default, the output file is located in <install_root>\logs directory. For example:

By default, all log categories use one appender, JReportRollingFile. However, you can also define different output appenders or files for different log categories in the LogConfig.properties file, which is located in <install_root>\bin. For example, to add another log appender - JReportConsole for the Designer, edit the LogConfig.properties file as follows:

log4j.logger.com.jinfonet.designer=, JReportRollingFile, JReportConsole
...
log4j.appender.RootConsole=org.apache.log4j.ConsoleAppender
log4j.appender.RootConsole.layout=com.jinfonet.util.JRPatternLayout
log4j.appender.RootConsole.layout.ConversionPattern=%m [%t][%p][%d{HH:mm:ss,SSS}]%n
log4j.appender.RootConsole.threshold=ON
log4j.appender.RootConsole.target=System.out
...

Logging information using the trace and error type

The JReport logging system enables you to log situations by using the trace and error type. Trace is used for logging something expectable or regular, such as tracing a program workflow, logging runtime information and associated elements. Error is used for logging something unexpected or irregular. For example, when a URL is unreachable, a file does not exist, or a table cannot be found in a data source.

Trace type is divided into four levels, and is ordered according to the amount of information logged, from the least to the most. These levels are OFF, OUTLINE, INFO, and TRIVIAL. Similarly, error type is also divided into four levels, and is ordered according to the amount of information logged, from the least to the most. These levels are OFF, FATAL, ERROR, and WARN.

If you want the least amount of information to be logged, you can set trace level to OUTLINE and error level to ERROR. If you want the most amount of information to be logged, you can set trace level to TRIVIAL and error level to WARN. Setting these to the highest level could affect system performance as well as disk usage.

Trace levels

Error levels

Configuration settings - effect on performance

The following are configuration properties which have an effect on performance: