Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Specifying a path to a Log Directory at run time; Report Viewer App
Specifying a path to a Log Directory at run time; Report Viewer App [message #718211] Tue, 23 August 2011 11:44 Go to next message
John Roberts is currently offline John Roberts
Messages: 18
Registered: August 2011
Junior Member
Hi:

I am deploying to Weblogic, in an environment where the war is deployed and exploded in a Weblogic temp dir. This means by default that the Birt report viewer is going to log there by default. I cannot enter an absolute or relative path in the viewer web.xml file since that is not going to be reliable for me. I would like to somehow set the log path at runtime using an env var or props value. Is this possible??
Re: Specifying a path to a Log Directory at run time; Report Viewer App [message #718255 is a reply to message #718211] Tue, 23 August 2011 13:56 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

John

I do not know of an easy way to do this. One way would be to run a
report that stops report logging and restarts based on a new
configuration. For example look at this beforeFactory example:


importPackage(Packages.java.util.logging);
importPackage(Packages.org.eclipse.birt.report.engine.api.impl);


config = reportContext.getReportRunnable().getReportEngine().getConfig();
config.setLogMaxBackupIndex(1);
config.setLogRollingSize(5000);
var dir =
reportContext.getReportRunnable().getReportEngine().getConfig().getLogDirectory();
var newdir = "c:/test7";
config.setLogConfig(newdir, Level.FINEST );


EngineLogger.stopEngineLogging();
var logger = config.getLogger( );
var dest = config.getLogDirectory( );
var file = config.getLogFile( );
var level = config.getLogLevel( );
var rollingSize = config.getLogRollingSize( );
var maxBackupIndex = config.getLogMaxBackupIndex( );
EngineLogger.startEngineLogging( logger, dest, file, level,rollingSize,
maxBackupIndex );

Jason


On 8/23/2011 11:44 AM, John Roberts wrote:
> Hi:
>
> I am deploying to Weblogic, in an environment where the war is deployed
> and exploded in a Weblogic temp dir. This means by default that the Birt
> report viewer is going to log there by default. I cannot enter an
> absolute or relative path in the viewer web.xml file since that is not
> going to be reliable for me. I would like to somehow set the log path at
> runtime using an env var or props value. Is this possible??
Previous Topic:localization file
Next Topic:OOM in 2.6.2
Goto Forum:
  


Current Time: Wed Aug 20 08:46:17 EDT 2014

Powered by FUDForum. Page generated in 0.02300 seconds