Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Log4j in eclipse 4 application
Log4j in eclipse 4 application [message #961819] Sun, 28 October 2012 12:29 Go to next message
Jim Jone is currently offline Jim Jone
Messages: 11
Registered: October 2012
Junior Member
What is the standard practice when it comes to logging in an eclipse application?
I want to use log4j and to do that I created a plugin from a jar.
This works but log4j.xml is now coupled with the corresponding plugin and for the end user to turn-on/off debugging is not easy as he must search and find log4j inside plugins.
I thought to use:

org.apache.log4j.xml.DOMConfigurator.configure(System.getProperty("user.dir")+"\\log4j.xml");


on my application startup but I am not really sure where would be the most appropriate place to run this.
So am I following the right approach? Any help?
I could not find any online resources for log4j in eclipse/osgi applications.
Re: Log4j in eclipse 4 application [message #966804 is a reply to message #961819] Thu, 01 November 2012 04:41 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph Keimel
Messages: 297
Registered: December 2010
Location: Germany
Senior Member
You could add a listener to org.osgi.service.log.LogReaderService and forward the log messages to log4j.
Re: Log4j in eclipse 4 application [message #967013 is a reply to message #966804] Thu, 01 November 2012 08:19 Go to previous message
Christoph Keimel is currently offline Christoph Keimel
Messages: 297
Registered: December 2010
Location: Germany
Senior Member
This is a good article on logging with OSGi:
http://ekkescorner.wordpress.com/2008/09/24/logging-in-osgi-enterprise-applications-part-1/
Previous Topic:Redirect std out inside console
Next Topic:[p2] How to disable the "Review Licenses" dialogue?
Goto Forum:
  


Current Time: Sat Apr 19 15:57:11 EDT 2014

Powered by FUDForum. Page generated in 0.01533 seconds