Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

How can I configure the logging/How to turn off debugging messages

Configuring

...

logging

...

Logging is controlled by the JFreeReport configuration. You can tweak the configuration by creating a 'jfreereport.properties' file, putting that into the root of your classpath (the 'default' package, or for instance WEB-INF/classes, if you're in a Servlet-Container).

The Log-Level is controlled by the property 'org.jfree.base.LogLevel', which can have the one of the following values: 'Debug', 'Info', 'Warn', 'Error'. The log-level should be at least at Warn so that you receive information on non-critical errors (like missing column names, etc.) which do not cause the reporting to fail, but may indicate an error in the report definition file.

Code Block

# The minimum loglevel that is logged.
org.jfree.base.LogLevel=Info

In the very unlikely case that you dont want to log to System.out and want to use a different logging mechanism, you can switch the logger implementation using the configuration as well.

To use Log4J, use

Code Block

org.jfree.base.LogTarget=org.jfree.logger.log4j.Log4JLogTarget

...

for the Pentaho-Report-Designer

The Pentaho Report-Designer ships with Log4J and therefore can be configured by placing a "log4j.xml" file into the "$(PRD-Installation-Dir)/resources" directory. In Pentaho Report-Designer 3.6, a properly configured log4j-configuration file exists already.

Code Block

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  Log4j Configuration                                                  -->
<!--                                                                       -->
<!-- ===================================================================== -->

<!-- $Id: log4j.xml,v 1.1.2.4 2005/10/06 23:05:58 bill Exp $ -->

<!--
   | For more configuration infromation and examples see the Jakarta Log4j
   | owebsite: http://jakarta.apache.org/log4j
 -->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
      <param name="Target" value="System.out"/>
      <param name="Threshold" value="INFO"/>

      <layout class="org.apache.log4j.PatternLayout">
         <!-- The default pattern: Date Priority [Category] Messagen -->
         <!--
         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
         -->
         <!--
         NOTE: %F:%M:%L (File:Method:Line) is useless because of the way Kettle logs messages.
         They always show up as coming from the LogWriter class.  Also, it is expensive to
         generate the location information (although since there is only ever one location
         I imagine it gets cached and reused throughout the life of the application).
         <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L)  -%m%n"/>
         -->
         <param name="ConversionPattern" value="%-5p [%d{MM-dd HH:mm:ss,SSS}] - %m%n"/>
      </layout>
   </appender>

   <category name="org.pentaho">
      <priority value="DEBUG"/>
   </category>

   <category name="com.healthmarketscience.jackcess">
      <priority value="WARN"/>
   </category>

   <category name="org.apache.commons.httpclient">
       <priority value="WARN"/>
   </category>

   <category name="org.mortbay">
      <priority value="ERR"/>
   </category>

   <category name="java.net">
      <priority value="NONE"/>
   </category>

   <category name="org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient">
      <priority value="WARN"/>
   </category>

   <category name="org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient.auth">
      <priority value="WARN"/>
   </category>

   <root>
      <priority value="INFO"/>
      <appender-ref ref="CONSOLE"/>
   </root>

</log4j:configuration>

Configuring the logging system for Pentaho Reporting Classic 0.8.10 and later

Since version 0.8.10, we use Apache-Commons-Logging for all Logging activities. If Log4J is on the Classpath, Apache-Commons-Logging will automatically use this logsystem and all logging activities must be configured via Log4J.

...

Code Block
org.apache.commons.logging.simplelog.defaultlog=trace
org.apache.commons.logging.simplelog.log.org.pentaho.reporting=trace
org.apache.commons.logging.simplelog.log.com.opensymphony.oscache=warn
org.apache.commons.logging.simplelog.log.net.sf.ehcache=warn
org.apache.commons.logging.simplelog.showlogname=true

Draft: Functions and expressions

Both Expressions and Functions are parametrized as JavaBeans by creating getter and setter methods. Both use the getValue() function to return the computed value and both should create a new fresh instance that does not share any modifiable object whenever the getInstance() method is called.

Expressions

Expressions are stateless, that means every call to the expression's getValue() is only dependent on the Expression's parameters and the values read from the datarow. The order in which expressions are called is not guaranteed, so it can be that the expression is called for the first row, then the 10th row and then for any other row. Due to their statelessness, expressions are cheap, as we do not have to clone them all the time to save their state.

Functions

Functions are statefull computations. Functions receive events (@see the Function interface) in a defined order, and maintain and update their state on every event. As the reporting engine iterates over the data multiple time, Functions get called several time. Each iteration has a processing-level, which describes the global state of the report-processing. Processing-levels greater or equal zero are function-processing levels, where functions compute the values. Level -1 (LayoutProcess.LEVEL_COLLECT) is reserved for layout preparations and Level -2 (LayoutProcess.LEVEL_PAGINATE) computes the layout.

The order of the function processing can be controlled via the Dependency-Level property of the Function. Functions with a higher dependency level are executed before functions with a lower dependency level. Functions will not be executed until the processing reached their respective level so that they do not see invalid results.

Functions that perform running computations (like the ItemSumFunction) are easy, as they can rely on the standard clone() functionality for the state management and simply recompute everything from scratch on each processing level.

Functions that compute global values (like the TotalGroupSumFunction), where function results are available before all data for the processing level has been processed are more complicated. These functions compute the running value in their defined processing level (@see FunctionUtilities.isDefinedPrepareRunLevel(..)) and store the result in a internal storage (usually a Map). On any later processing run, they simply recall the stored value to make it possible to print the value in report- or group-headers.

The event-order functions receive is well-defined. When saving report-states, the reporting engine will clone the function. This way, for a single function-instance, the event-flow always appears linear. The event-order is documented in the Wiki: http://wiki.pentaho.com/display/Reporting/JFR8States

...

Configuring the logging system for Pentaho Reporting Classic 0.8.9 and older

Logging is controlled by the JFreeReport configuration. You can tweak the configuration by creating a 'jfreereport.properties' file, putting that into the root of your classpath (the 'default' package, or for instance WEB-INF/classes, if you're in a Servlet-Container).

The Log-Level is controlled by the property 'org.jfree.base.LogLevel', which can have the one of the following values: 'Debug', 'Info', 'Warn', 'Error'. The log-level should be at least at Warn so that you receive information on non-critical errors (like missing column names, etc.) which do not cause the reporting to fail, but may indicate an error in the report definition file.

Code Block

# The minimum loglevel that is logged.
org.jfree.base.LogLevel=Info

In the very unlikely case that you dont want to log to System.out and want to use a different logging mechanism, you can switch the logger implementation using the configuration as well.

To use Log4J, use

Code Block

org.jfree.base.LogTarget=org.jfree.logger.log4j.Log4JLogTarget

We also support Jakarta-Commons (org.jfree.logger.jcl.JakartaLogTarget) and JDK14 style logging (org.jfree.logger.java14.Java14LogTarget). These log-target implementation can be found in the JCommons-Logging package. (Downloadable at http://www.jfree.org/jcommon/download/ )