|
Re: Logging from EventHandler [message #541243 is a reply to message #541228] |
Fri, 18 June 2010 21:11 |
|
Bill
Try:
public void beforeOpen(IDataSetInstance dataSet,
IReportContext reportContext) {
try{
Logger logger =
reportContext.getReportRunnable().getReportEngine().getLogge r();
logger.log(Level.INFO,"test");
}catch(Exception e){
e.printStackTrace();
}
}
Jason
On 6/18/2010 2:39 PM, Bill Knotts wrote:
> 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");
> }
|
|
|
|
Re: Logging from EventHandler [message #541631 is a reply to message #541612] |
Mon, 21 June 2010 20:35 |
|
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.02040 seconds