Saturday, November 22, 2008

iReport logging

I have been using the iReport IDE for Jasper Reports template creation. One strange thing about this report of iReport: I do not see a way to see a compilation or a runtime error/message log. If an error occurs, by default the report simply does not run.

A friend of mine finally figured out a way to get some messaging out by using log4j: here was the note he sent to me:

I found a way to get iReport to log. If you start iReport from the .bat file supplied in the bin directory, you can add log4j configuration to JVM command; i.e., in the bin/startup.bat file, add the following to the java command: -Dlog4j.configuration=file:C:\bea\domains\oppenDomain\config-oppen\log4j.xml

(make sure you’re pointing to a valid xml file!



p.s. the full command should look something like:

java -cp "%IREPORT_CLASSPATH%" -Dlog4j.configuration=file:C:\bea\domains\oppenDomain\config-oppen\log4j.xml -Direport.home="%IREPORT_HOME%""%IREPORT_HOME%/policy.all" -Xms128m -Xmx512m it.businesslogic.ireport.gui.MainFrame %*

No comments: