BIRT logging using log4j
#1
Posted 27 February 2009 - 09:17 AM
I am using the Report Engine within my application... My application uses log4j for all of its logging...
How do I get BIRT to simply use my established log4j Logger to handle its logging needs?
I had thought that using setLogger() on the EngineConfig would do the trick. Unfortuately, it appears that setLogger() cannot take a org.apache.log4j.Logger object as its argument ...
What is the magic incantation here?
Thanks!
-Dennis
#2
Posted 02 March 2009 - 02:22 PM
#3
Posted 19 March 2009 - 05:16 AM
I had question regarding your post suggesting the Eclipsepedia link. Where would I put the "test.java" or "test.class" file in my Web project (e.g. WAR file)? Somewhere under WEB-INF?
Also, in step 3 where is the java.home folder? I'm running Tomcat 5.5 and have a 'Dynamic BIRT Web project' deployed on the server. Would the properties file go under common/classes?
Thanks!
-Andy
#4
Posted 19 March 2009 - 06:46 AM
Can you jar the test class and put it the common/lib for tomcat?
If you want to set the location of the logging.properties file, in the startup of tomcat set it as part of the JAVA_OPTS
set JAVA_OPTS=%JAVA_OPTS% -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
Run the attached report to see if the logging.properties file is set.
Jason
Attached File(s)
-
info.rptdesign (11.58K)
Number of downloads: 9 -
info.rptdesign (11.58K)
Number of downloads: 9
#5
Posted 19 March 2009 - 08:28 AM
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.
4admin.org.apache.juli.FileHandler.level = FINE
4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4admin.org.apache.juli.FileHandler.prefix = admin.
5host-manager.org.apache.juli.FileHandler.level = FINE
5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5host-manager.org.apache.juli.FileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter..........................
#7
Posted 19 March 2009 - 10:58 AM
package reports;
import java.util.logging.Logger;
...........
...
public class Report implements StatefulJob {
private IReportEngine birtReportEngine = null;
protected static Logger logger = Logger.getLogger("org.eclipse.birt");
...........
......
Thank you very much for your prompt assistance!
-Andy




MultiQuote
