Configuring System Logs

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.

Managing Log Settings

To set the current logging levels:

1. Log in as system administrator (superuser by default).
2. Select Manage > Server Settings and choose Log Settings in the left-panel.
3. In the Log Settings panel, use the drop-down selectors to change the log level for each class being logged.

System Log Settings

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. Any change to the logging levels takes effect immediately, without restarting JasperReports Server.

These logging levels override the levels in the log4j.properties file. As of JasperReports Server version 5.0, these settings persist even when the server is restarted. Therefore the values on the Log Settings page that are in effect on the server may differ from settings in the log4j.properties file. For details, see Configuration Settings in the User Interface.

The four logging levels indicate the type of event 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 describing 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 ERROR, as configured in log4j.properties. A logger without 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 used to find it 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

CommonDomain-
DataStrategy

SubFilterInputControl-
Generator

Others

Logs various activities of the Ad Hoc data policy implementations, which use SQL queries or in-memory operations to get datasets for Ad Hoc views.

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
Converter

Logs information about the conversion between DomEL and JSON, which is used by Ad Hoc filters.

Domain-based security tests

SemanticLayerSecurityResolver
Impl

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 life cycle of datasets that are cached in memory when Ad Hoc views 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.

Ad Hoc AJAX requests

adhocAjaxRequests

Logs information about AJAX requests made by Ad Hoc Editor and dashboard designer, including report parameters and response times. Enable this setting when you want to understand the Ad Hoc Editor and dashboard designer or if you’ve encountered an error or slow response times.

Ad Hoc cache activity

com.jaspersoft.commons.
datarator.CachedData

Tracks the life cycle of datasets managed by the Ad Hoc cache as they transition between states. This log output includes information from the Ad Hoc cache in a format that lends itself to troubleshooting. Use this setting to understand how query response times contribute to the performance and responsiveness of the Ad Hoc Editor. Because it doesn't log the queries themselves, use it in conjunction with the SQL Query Executer log setting.

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. Log in as system administrator (superuser by default).
2. Select Manage > Server Settings and choose Log Settings in the left panel.
3. Scroll to the bottom of the page.
4. 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

5. Use the drop-down to set the logging level.

The logger setting is persistent even when the server is restarted. However, the logger setting may not appear on the Log Settings page again. For information about adding loggers to this page permanently, see Adding a Logger to the Log Settings Page.

Log Configuration Files

You can edit the log configuration file to set loggers, logging levels, and log output, but you must restart the server for your changes to take effect.

If you've made modifications in the Log Settings UI, those settings are persistent in the repository, and take precedence over the configuration files. However, these changes are not written to the configuration files. Each setting is independent, so a value that's not modified in the Log Settings UI is taken from the corresponding file. For more information, see Configuration Settings in the User Interface.

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.properties file as log4j.logger.org.acegisecurity.intercept. If you want to add a new logger, find its classname in the source.

The file you edit depends on whether you're configuring server logging or logging during import and export.

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 commented out, simply remove the comment character (#) to add the logger. Otherwise, add the logger’s classname and set the 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.

Adding a Logger to the Log Settings Page

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, we recommend that you add loggers from the web interface by entering them into the text field on the Log Settings page. Edit the configuration file only 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-classname> = <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 files for those locales. 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 Localization.

Version: 
Feedback