This section describes the settings that control the information JasperReports Server writes to its logs.
The log files contain important information about how the server is running. JasperReports Server uses the Apache log4j package to generate log files. Jaspersoft uses the slf4j facade to wrap log4j.
• The default log file is WEB-INF\logs\jasperserver.log.
• The default log configuration file is WEB-INF\log4j.properties.
To set the current logging levels, click Manage > Log Settings; you must be logged in as superuser to access this menu.
The page lists some of the currently-enabled loggers (ones that typically need their logging levels adjusted from time to time) with their logging level. By selecting values from the drop-downs on the page, you can change the logging levels without restarting JasperReports Server.
|
These logging levels override the levels in the log4j.properties file. However, the override applies only until JasperReports Server is restarted. Logging levels revert to their log4j.properties settings when the server is restarted. |
|
System Log Settings |
The four logging levels indicate the type of event that is recorded by a logger:
Setting |
Level of Information |
ERROR |
Writes minimal information to the log describing serious program faults. |
WARN |
Writes error and warning messages to the log. Warning messages contain cautionary information to help you to decide whether the logged events require your attention. |
INFO |
Writes error, warning, and informational messages to the log. Informational messages describe significant events, such as those that affect application performance. |
DEBUG |
Writes error, warning, informational, and additional messages to the log. Debug messages are very detailed and often voluminous. Use this setting only to diagnose a problem. DEBUG can impact system performance and should not be used in production environments. If several loggers are set to DEBUG, the server may generate huge logs, and performance can suffer. |
JasperReports Server’s default root logger setting is WARN, as configured in log4j.properties. A logger that does not have an assigned value inherits the setting of its parent in log4j.properties.
The following table lists each logger name as it appears on the Log Settings page, the identifier to use to find a particular log in the log file, and a description of the logger.
Logger Name |
Identifier in log |
Description |
|||||||||
SQL query executer |
JRJdbcQueryExe cuter |
Logs SQL text and parameter values for queries that are run by the SQL query executer. |
|||||||||
Input control value queries |
valueQueryLog |
Logs SQL text and parameter values for queries associated with input controls. |
|||||||||
Cascading input control parameter resolution |
FilterCore |
Logs activity associated with cascading input controls. Query-driven input controls can cascade when a query has a parameter whose value comes from another input control. When the parameter value is changed, the query is automatically rerun, possibly changing the list of values for its input control. |
|||||||||
Cascading input control query result caching |
TokenControlLogic |
Logs use of the cache for results of cascading input control queries. |
|||||||||
Hibernate SQL |
SQL |
Logs SQL run by the Hibernate layer to access the JasperReports Server repository database. This logger generates a large volume of logging that could affect performance. |
|||||||||
Ad Hoc data policy logging |
|
Logs various activities of the Ad Hoc data policy implementations, which use SQL queries or in-memory operations to get datasets for Ad Hoc reports. |
|||||||||
SQL generated for Domain queries |
JdbcBaseDataSet |
Logs SQL queries generated from queries using a Domain. |
|||||||||
Connection handling for Domains |
DataSourceResolverImpl |
Logs use of JDBC connections used by Domains to run SQL queries. |
|||||||||
Expression to JSON converter |
ExpressionJSON |
Logs information about the conversion between DomEL and JSON, which is used by Ad Hoc filters. |
|||||||||
Domain-based security tests |
SemanticLayerSecurityResolver |
Logs activity related to Domain column- and row-level security. |
|||||||||
Cascading input control resolution for Domains |
DomainFilterResolver |
Logs the same activity as the FilterCore logger (Cascading input control parameter resolution) above, but adds information specific to Domain queries. |
|||||||||
Ad Hoc cache activity |
CachedData |
Logs information about the lifecycle of datasets that are cached in memory when Ad Hoc reports are accessed. |
|||||||||
Timing for SQL queries run for reports |
JsControlledJdbcQueryExecuter |
Logs the time it takes a query run by the SQL query executer to return data to a report. |
|||||||||
Ad Hoc WorkingDataSet |
WorkingDataSet |
Logs activity for the WorkingDataSet, used by the Ad Hoc Editor to perform in-memory dataset transformations of query results. |
|||||||||
General controller |
AdhocAjaxController |
Logs activity of the Ad Hoc Editor. |
|||||||||
Crosstab controller |
AdhocCrosstabAjaxController |
Logs additional activity of the Ad Hoc Editor specific to crosstab reports. |
|||||||||
Groovy code generation for memory datasets |
GroovyGenerator |
Logs Groovy classes generated from DomEL expressions used by the Ad Hoc Editor for filters and calculated fields. |
You can add other loggers to the Log Settings page if you know their classnames.
To add a logger to the page from the web interface:
1. | Click Manage > Log Settings. |
2. | Scroll to the bottom of the page. |
3. | Enter the logger’s classname in the text field. |
See the other properties on the page for guidance. For example:
com.jaspersoft.ji.adhoc.action.AdhocCrosstabAjaxController
4. | Use the drop-down to set the logging level. |
The logger will be removed when the server is restarted. For information about adding loggers to this page permanently, see See "Adding a Logger to the Log Settings Page".
Edit the log configuration file to set loggers, logging levels, and log output. Unlike changes made in the web interface, changes made directly to the log configuration files are persistent. Restart the server for your changes to take effect.
Logger names are defined in the Java source. Loggers can have any name, but the Jaspersoft convention is to give them their full class names. In the log4j properties file, the classname must be preceded by log4j.logger. For example, the classname org.acegisecurity.intercept is represented in the log4j.poperties file as log4j.logger.org.acegisecurity.intercept is org.acegisecurity.intercept. If you want to add a new logger, find its classname in the source.
Depending on your whether you are configuring server logging or logging during import and export, edit a different file:
Functionality to Log |
File Location |
Import/Export |
<js-install>\buildomatic\conf_source\iePro |
JasperReports Server |
WEB-INF\log4j.properties in the JasperReports Server installation |
If the logger is defined in the configuration file but is commented out, simply remove the comment character (#) to add the logger. Otherwise, add the logger’s classname and set it to the desired logging level.
The form of a logger definition should be:
log4j.logger.logger_classname = log_level, output_type
where:
• logger_classname is the name of the class you want to monitor.
• log_level is ERROR, WARN, INFO, or DEBUG
• output_type is a standard output type, such as stdout.
For example:
log4j.logger.org.springframework.webflow=DEBUG, stdout, fileout
Restart the server for your changes to take effect.
If you know of a log4j logger that JasperReports Server uses, you can add it to the Log Settings page available to the superuser. To add a logger, edit a configuration file.
|
Because editing text files can be error-prone, Jaspersoft recommends that you add loggers from the web interface by entering them into the text field on the Log Settings page. Only edit the configuration file if you need to permanently add the logger. |
To edit the list of loggers to be displayed on the page:
1. | Edit the logger_descriptions_pro.properties file found under WEB-INF/bundles in your JasperReports Server installation. |
2. | Add a new line and specify the logger’s classname and a brief description of it. |
Entries should be in the form <logger name> = <description>.
See the other properties in the file for guidance. For example:
com.jaspersoft.ji.adhoc.action.AdhocCrosstabAjaxController = Crosstab controller
3. | Restart the server for your changes to take effect. |
|
The logger_descriptions_pro.properties file controls the labels for the English locale. You can specify labels for other locales by editing the logger description property file for that locale. For example, to add the label in French, add an entry to the logger_descriptions_pro_fr.properties file. For more information on supporting other languages, refer to the JasperReports Server Administrator Guide. |