How can I configure the logging/How to turn off debugging messages
Configuring logging 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.
For development purposes, it can be useful to reroute all logging to System.err instead. For this, you need to have two properties file on your classpath:
In commons-logging.properties you configure the logging system to be used. The following configuration forces commons-logging to use System.err for all logging.
Code Block |
---|
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
|
The log-level and log-filters can now be configured using a file called simplelog.properties.
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
|
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).
...
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/ )
How to include Definitions from the Pentaho Report-Wizzard or Pentaho Report-Designer into Swing Applications
The scope of Pentaho Reporting's development is primarily focused on generating great content in an easy way. Therefore Pentaho Reporting does not come with any automatic query-management, like the Pentaho-Plattform does.
The scope of Pentaho Reporting's development is primarily focused on generating great content in an easy way. Therefore Pentaho Reporting does not come with any automatic query-management, like the Pentaho-Plattform does. The Pentaho-Plattform, for now, does not come with the ability to start Pentaho Reporting's GUI.
Using MDX-Queries without the Plattform is hard, if not impossible. Including JDBC-Queries, however, is easy and can be done in a few lines of code.
This manual coding is ugly and will change sooner or later.
Both GUI tools generate an XAction and a report definition file. The XAction file describes how the Pentaho-Plattform prepares the report and which parameters are needed to configure the report processing.
Important: The Report-Designer uses an abstract report definition model as internal storage format. These definitions have the extension '.report'. Pentaho Reporting cannot understand these files - you have to export the report to generate the '.xml' file (the Pentaho Reporting report definiton) and the corresponding action sequence.
You can safely ignore that file, except for one thing: It also contains the SQL-Query string that is needed to get the data for the report. So fire up your favourite XML or Text-editor and extract the query string. (It is contained in an element <query> inside the action-definition.)
The code to get a JDBC-ResultSet is standard JDBC code, there's nothing special here. Get a connection, create a statement and fire the query.
...
...
)
...
Now we have the data, but Pentaho Reporting needs TableModels to work with. So let's wrap that resultset into a TableModel. The ResultSetTableModelFactory is part of Pentaho Reporting's core code.
Code Block |
---|
final CloseableTableModel model =
ResultSetTableModelFactory.getInstance().createTableModel(resultSet);
|
The ".xml" file the tools created contain your report definition. Copy that file into a suitable location and obtain an URL to that xml-file. Use the 'executeReport' method from above together with your URL and the tablemodel and execute the report. After the reporting, don't forget to close the TableModel to free the ResultSet.