Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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 Jul 05 08:54:18 EDT 2025

Powered by FUDForum. Page generated in 0.42632 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top