JReport provides a robust, flexible and configurable logging system, which is based on log4j version 1.2.8. JReport also supports versions of 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:
Log configuration tasks can be achieved in three ways. They are:
<install_root>\bin
directory.In comparison with earlier versions, the command options used for log configuration have undergone a considerable change. The following are descriptions of these options:
Options | Description |
---|---|
-vDebug | Enables JReport Engine to output messages to a file and sets engine log file's trace level to INFO and error level to WARN. |
-vError | Enables JReport Engine to output messages to a file and sets engine log file's trace level to OFF and error level to ERROR. |
-logall | Sets all loggers' trace level to INFO and error level to WARN. |
-log[:file Name] | Outputs JReport Engine messages to the file as specified and uses the -vDebug level. |
Note: Any settings made using the command options will override the trace and error type level settings in the LogConfig.properties file.
The JReport logging system enables you to trace both normal and abnormal situations by using the trace and error type. Trace is used for logging something expected 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. For detailed information about the eight levels, see Log panel.
If you want the least amount of information to be logged, you can set trace level to OFF 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.
You can customize where to output logs in your local disk instead of using the default directory <install_root>\logs
.
By default, different log categories are output to different rolling files. For example, the Engine log is output to Engine.log in the <install_root>\logs
directory. If you want to customize the location of the Engine log file, take the following steps:
<install_root>\bin
directory. C:\logs\Engine.log
(on Windows) or /logs/Engine.log
(on Linux/Unix).The following are configuration properties which have an effect on server performance:
<install_root>\bin
directory.