Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Logging from an Event Handler
bhanley
I am having trouble with a Java-based event handler bound to an event on a BIRT report. It is generating a Null Pointer Exception when I run it on the iServer. Where would an event handler write its logs to? I have calls to System.out.println in the code, but I cannot find the correct logs. A better solution would be to have the event handler use log4j, but i do not know where to put my log4jproperties file on the iServer.
Thanks for any help!
Find more posts tagged with
Comments
bhanley
Answering my own question, this solution below is working great.<br />
<br />
<br />
The iServer Java factory and view server (where the BIRT runs) use JUL (java.util.logging). The output goes to: <br />
<br />
Factory: jfctsrvrXXXXX.log<br />
<br />
View server: jsrvrXXXX.log<br />
<br />
The java.util.logging (JUL) instance can be retrieved by calling the following in your code in your class.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>ILogger logger = Logger.getLogger(<Your class name>.class.getName());</pre>
<br />
Replace the <Your class name> with the current class name.<br />
<br />
Since we registered a log handler(log file) at root level, any logger registered under it will be handled by it.<br />
<br />
For more information on how JUL works, please refer to:<br />
<br />
<a class='bbc_url' href='
http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html'>Java
TM Logging Overview</a>