BIRT Exchange Forum: BIRT logging using log4j - BIRT Exchange Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

BIRT logging using log4j Rate Topic: -----

#1 User is offline   DButtery 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 30
  • Joined: 05-January 09

Posted 27 February 2009 - 09:17 AM

Hi all,

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
0

#2 User is offline   JasonW 

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 903
  • Joined: 08-August 07

Posted 02 March 2009 - 02:22 PM

Dennis.

Can you try:
BIRT/FAQ/Deployment - Eclipsepedia
and report back?

Jason
0

#3 User is offline   AndyL 

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 03-June 08

Posted 19 March 2009 - 05:16 AM

Jason,
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
0

#4 User is offline   JasonW 

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 903
  • Joined: 08-August 07

Posted 19 March 2009 - 06:46 AM

Andy,

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)


0

#5 User is offline   AndyL 

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 03-June 08

Posted 19 March 2009 - 08:28 AM

Okay, I already have a logging.properties file with contents such as below.... Should I comment everything in the file out? Or perhaps comment everything having to do with catalina?

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..........................
0

#6 User is offline   JasonW 

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 903
  • Joined: 08-August 07

Posted 19 March 2009 - 08:32 AM

Try creating a clean properties file first. You can then reenable all the tomcat logging.
0

#7 User is offline   AndyL 

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 03-June 08

Posted 19 March 2009 - 10:58 AM

All things considered it has mostly worked. Someone who is no longer here had wrote some custom java files for utilizing Quartz in sending reports automatically. In the custom Report.java file, they are using the Birt logging which ends up in my "catalina.out" file !!! Would you know how to instantiate the existing logger I'm using with Log4j instead of the old Birt logger. Here is my current code below:

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
0

#8 User is offline   JasonW 

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 903
  • Joined: 08-August 07

Posted 20 March 2009 - 05:16 AM

Andy,

Did you change the code to use log4j?

private static org.apache.log4j.Logger log = Logger
.getLogger(LogCorg.eclipse.birt");

Jason
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users