Jump to: navigation, search

Difference between revisions of "Logging The Events - Show the Typical Log Stack (BIRT)"

Line 1: Line 1:
[[Examples (BIRT)]]
Logging The Events - Show the Typical Log Stack (BIRT)
Logging The Events - Show the Typical Log Stack (BIRT)
This example is Bugzilla ID [https://bugs.eclipse.org/bugs/show_bug.cgi?id=177044 Logging Example Code].  
This example is Bugzilla ID [https://bugs.eclipse.org/bugs/show_bug.cgi?id=177044 Logging Example Code].  

Revision as of 14:01, 12 March 2007

Examples (BIRT) Logging The Events - Show the Typical Log Stack (BIRT) This example is Bugzilla ID Logging Example Code.


The event model can be invoked from either JavaScript or Java. This entry provides two examples that use both interfaces to demonstrate the typical callstack invoked when running a report. Run either example report and look in your ECLIPSE_HOME directory, you will find log files generated for all of the events of the report.

BIRT Version Compatibility

This example was built using version 2.2 M5.

Example Files

Add a URL to your bugzilla attachment. eg. Example Logging Project Zipped


There are two report example java_logging_demo.rptdesign uses the java based event handler. Within the source directory you will find all of the event handler classes. Each event handler class uses the java.util.logging class to display the class and method that is doing the logging. A custom formatter is used to format out the class name and method name from a simple logger.info("") method.

The javascript_logging_demo.rptdesign does the same thing using only JavaScript. The initialization of the logging is done in the initialize method of the Report Element. In the JavaScript example the formattter is used, but this will not show the method and class adequately since it reports on the framework classes that are processing the script as opposed to the actual JavaScript methods.

NOTE: There is a significant distinction between how the logging will occur when run in the Preview tab and when displayed in the WebViewer. When using the Preview tab, the report is generated using the RunAndRender task, where the render events are called in line with the generation events. The WebViewer uses the RunThenRender task, which means that generate tasks occur separate from the render tasks. Since the Initialize method gets called for generate and presentation, the log gets reset for each context. This means that when this example runs in the WebViewer you will only see the Render tasks.


Please enter comments below by selecting the edit icon to the right. You will need a Bugzilla account to add comments.