Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Log file rotation
juhi
I am using birt v3.7.1 and mongodb-oda plugin for birt.
There are log files getting created under tomcat/logs folder ReportEngine_date_time.log every time i send a request for the birt report. There is unnecessary space utilization and there is nothing that seems to be useful on any of the BIRT sites. Also there are ODA-HELPER logs getting generated where the .rptdesign files are placed on the disk under the package "logs\org.eclipse.datatools.connectivity.oda.consumer\org.eclipse.birt.report.data.oda.mongodb\"> for each request.
How can I enable rotation of these log files and not allow them getting created on every request.
Find more posts tagged with
Comments
JasonW
Are you using the Viewer? Currently the viewer only supports setting the log level and location in the web.xml. If you are using the API you can set:
config = new EngineConfig( );
config.setLogConfig("c:/test7", Level.FINEST);
config.setLogMaxBackupIndex(1);
config.setLogRollingSize(2000);
Platform.startup( config );
I have tried making these settings within a beforeFactory script of a report I run once with some success.
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();
config.setLogConfig(newdir, Level.FINEST );
var el = new EngineLogger();
el.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( );
el.startEngineLogging( logger, dest, file, level,rollingSize, maxBackupIndex );
Jason
juhi
I am not using the viewer but the api. I will try the code snippet you have mentioned and let know if it works with me.<br />
<br />
Juhi.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="96033" data-time="1329173622" data-date="13 February 2012 - 03:53 PM"><p>
Are you using the Viewer? Currently the viewer only supports setting the log level and location in the web.xml. If you are using the API you can set:<br />
<br />
config = new EngineConfig( );<br />
config.setLogConfig("c:/test7", Level.FINEST); <br />
config.setLogMaxBackupIndex(1);<br />
config.setLogRollingSize(2000);<br />
Platform.startup( config );<br />
<br />
I have tried making these settings within a beforeFactory script of a report I run once with some success.<br />
<br />
importPackage(Packages.java.util.logging);<br />
importPackage(Packages.org.eclipse.birt.report.engine.api.impl);<br />
<br />
config = reportContext.getReportRunnable().getReportEngine().getConfig();<br />
config.setLogMaxBackupIndex(1);<br />
config.setLogRollingSize(5000);<br />
var dir = reportContext.getReportRunnable().getReportEngine().getConfig().getLogDirectory();<br />
config.setLogConfig(newdir, Level.FINEST );<br />
<br />
var el = new EngineLogger();<br />
el.stopEngineLogging();<br />
var logger = config.getLogger( );<br />
var dest = config.getLogDirectory( );<br />
var file = config.getLogFile( );<br />
var level = config.getLogLevel( );<br />
var rollingSize = config.getLogRollingSize( );<br />
var maxBackupIndex = config.getLogMaxBackupIndex( );<br />
el.startEngineLogging( logger, dest, file, level,rollingSize, maxBackupIndex );<br />
<br />
Jason<br /></p></blockquote>
juhi
<blockquote class='ipsBlockquote' data-author="'juhi'" data-cid="96098" data-time="1329281350" data-date="14 February 2012 - 09:49 PM"><p>
I am not using the viewer but the api. I will try the code snippet you have mentioned and let know if it works with me.<br />
<br />
Juhi.<br /></p></blockquote>
<br />
The above mentioned code snippet works perfectly foe report engine logs. But any idea about the ODAHELPERLOG files getting generated? How can i rotate them with the help of api? If not api, can i use logrotate.d?
JasonW
Can you post the plugin.xml for the oda you are using?
Jason
juhi
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="96527" data-time="1329950129" data-date="22 February 2012 - 03:35 PM"><p>
Can you post the plugin.xml for the oda you are using?<br />
<br />
Jason<br /></p></blockquote>
<br />
Here is the plugin.xml for the mongodb oda driver m using.<br />
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<?eclipse version="3.4"?><br />
<plugin><br />
<br />
<extension<br />
id="%oda.data.source.id"<br />
point="org.eclipse.datatools.connectivity.oda.dataSource"><br />
<dataSource<br />
driverClass="org.eclipse.birt.report.data.oda.mongodb.impl.OdaMongoDriver"<br />
defaultDisplayName="%data.source.name"<br />
setThreadContextClassLoader="false"<br />
odaVersion="3.2"<br />
id="%oda.data.source.id"><br />
<properties><br />
<property<br />
allowsEmptyValueAsNull="true"<br />
defaultDisplayName="Host Name"<br />
defaultValue="localhost"<br />
isEncryptable="false"<br />
name="hostName"<br />
type="string"><br />
</property><br />
<property<br />
name="port"<br />
allowsEmptyValueAsNull="true"<br />
defaultDisplayName="Port"<br />
type="string"<br />
isEncryptable="false"><br />
</property><br />
<property<br />
name="dbName"<br />
allowsEmptyValueAsNull="true"<br />
defaultDisplayName="Database Name"<br />
type="string"<br />
isEncryptable="false"><br />
</property><br />
<property<br />
name="userName"<br />
allowsEmptyValueAsNull="false"<br />
defaultDisplayName="User Name"<br />
type="string"<br />
isEncryptable="false"><br />
</property><br />
<property<br />
name="password"<br />
allowsEmptyValueAsNull="false"<br />
defaultDisplayName="Password"<br />
type="string"<br />
isEncryptable="false"><br />
</property><br />
</properties><br />
<traceLogging<br />
logDirectory="C:/temp"<br />
logFileNamePrefix="mongo_oda_log"<br />
logLevel="FINEST"><br />
</traceLogging><br />
</dataSource><br />
<dataSet<br />
defaultDisplayName="%data.set.name"<br />
id="org.eclipse.birt.report.data.oda.mongodb.dataSet"><br />
<dataTypeMapping<br />
nativeDataTypeCode="1"<br />
odaScalarDataType="String"<br />
nativeDataType="String"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="4"<br />
odaScalarDataType="Integer"<br />
nativeDataType="Integer"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="8"<br />
odaScalarDataType="Double"<br />
nativeDataType="Double"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="3"<br />
odaScalarDataType="Decimal"<br />
nativeDataType="BigDecimal"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="91"<br />
odaScalarDataType="Date"<br />
nativeDataType="Date"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="92"<br />
odaScalarDataType="Time"<br />
nativeDataType="Time"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="93"<br />
odaScalarDataType="Timestamp"<br />
nativeDataType="Timestamp"><br />
</dataTypeMapping><br />
<dataTypeMapping<br />
nativeDataTypeCode="16"<br />
odaScalarDataType="Boolean"<br />
nativeDataType="Boolean"><br />
</dataTypeMapping><br />
</dataSet><br />
</extension><br />
<extension<br />
point="org.eclipse.datatools.connectivity.connectionProfile"><br />
<category<br />
name="%data.source.name"<br />
parentCategory="org.eclipse.datatools.connectivity.oda.profileCategory"<br />
id="%oda.data.source.id"><br />
</category><br />
<connectionProfile<br />
pingFactory="org.eclipse.datatools.connectivity.oda.profile.OdaConnectionFactory"<br />
name="%connection.profile.name"<br />
category="%oda.data.source.id"<br />
id="%oda.data.source.id"><br />
</connectionProfile><br />
<connectionFactory<br />
name="ODA Connection Factory"<br />
profile="%oda.data.source.id"<br />
class="org.eclipse.datatools.connectivity.oda.profile.OdaConnectionFactory"<br />
id="org.eclipse.datatools.connectivity.oda.IConnection"><br />
</connectionFactory><br />
</extension><br />
<br />
</plugin>
JasonW
Can you change:
<traceLogging
logDirectory="C:/temp"
logFileNamePrefix="mongo_oda_log"
logLevel="FINEST">
</traceLogging>
set the level to OFF.
Jason