Logging from EventHandler [message #541228] |
Fri, 18 June 2010 14:39  |
Eclipse User |
|
|
|
I am writing a simple extension of a DataSourceEventAdapter and would like to be able to emit log messages from this class to the standard ReportEngine_*.log file. This has proven to be quite elusive...
Code excerpt:
public class JndiNameResolver extends DataSourceEventAdapter {
private Logger logger = Logger.getLogger(this.getClass().getName());
@Override
public void beforeOpen(IDataSourceInstance dataSource,
IReportContext reportContext) throws ScriptException {
if (logger.isLoggable(Level.FINER)) {
logger.entering(this.getClass().getName(), "beforeOpen");
}
.
.
.
I expected that I would need to alter the BIRT_VIEWER_LOG_LEVEL context parameter in web.xml or declare a new logger in viewer.properties to reflect the desired level of 'FINER' but neither of these approaches results in any output.
I've tried this both in the designer and in the viewer webapp deployed to a Tomcat server.
Debugging the event handler in the designer clearly shows that there are no logging handlers associated with the logger.
Any suggestions or hints would be appreciated...
Regards,
Bill
|
|
|
|
|
Re: Logging from EventHandler [message #541631 is a reply to message #541612] |
Mon, 21 June 2010 16:35  |
Eclipse User |
|
|
|
Bill,
Can you open a bug for this?
Jason
On 6/21/2010 3:10 PM, Bill Knotts wrote:
> Thanks Jason,
>
> This accomplished exatcly what I need when viewed via the BIRT Web
> Viewer but still seems to result in no output when tested in the BIRT
> Designer (2.5.1).
>
> I just re-tested this technique in both JavaScript and Java Event
> Handlers by:
> - deleting all files under my workspace
> '.metadata\.plugins\org.eclipse.birt.report.viewer\logs' directory
>
> - ensuring that web.xml value of BIRT_VIEWER_LOG_LEVEL under
> [eclipse_home]eclipse\plugins\org.eclipse.birt.report.viewer
> _2.5.1.v20090821\birt\WEB-INF has a value of 'INFO'
>
> - ensuring that no additional entries exist in viewer.properties at the
> same location
>
> In this case, when running the report in the designer, several log files
> are created under the logs directory but all are completely empty.
>
> Interestingly, debugging the Java Event Handler shows the logger being
> retrieved successfully but without any associated handlers.
>
> I can live with this in the short term but it seems like I am missing a
> valuable tool when working with a report design.
>
> Regards,
> Bill
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.48710 seconds