Jump to: navigation, search

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

(Example Files)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Examples (BIRT)]]
+
{{Backlink|Report Developer Examples (BIRT)}}
  
 
Logging The Events - Show the Typical Log Stack (BIRT)
 
Logging The Events - Show the Typical Log Stack (BIRT)
Line 9: Line 9:
 
== Example Files==
 
== Example Files==
 
Add a URL to your bugzilla attachment. eg.
 
Add a URL to your bugzilla attachment. eg.
[https://bugs.eclipse.org/bugs/attachment.cgi?id=177044 Example Logging Project Zipped]
+
[https://bugs.eclipse.org/bugs/attachment.cgi?id=60595 Example Logging Project Zipped]
 +
 
 
== Description==
 
== Description==
 
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.
 
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.
Line 20: Line 21:
 
Please enter comments below by selecting the edit icon to the right.
 
Please enter comments below by selecting the edit icon to the right.
 
You will need a Bugzilla account to add comments.
 
You will need a Bugzilla account to add comments.
[[Category:Birt]]
+
[[Category:BIRT]]
[[Category:Birt Example]]
+
[[Category:BIRT Example]]
[[Category:Birt Report Example]]
+
[[Category:BIRT Example Report]]

Latest revision as of 12:03, 12 July 2007

< To: Report Developer Examples (BIRT)

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

Introduction

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

Description

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.

Comments

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