Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » LogService does nothing(Starting and using a LogService implementation (like Equinox') does not create any output)
LogService does nothing [message #665810] Sat, 16 April 2011 09:32 Go to next message
Mario Scalas is currently offline Mario ScalasFriend
Messages: 32
Registered: July 2009
Member
I've several bundles that uses the LogService to perform logging.. Typically my code is like the following:


...
import org.osgi.service.log.LogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...

public class MasterApplicationBootstrapImpl {
	...
	private LogService logger; // OSGi service
        ... 
	private static Logger logger2 = LoggerFactory.getLogger( MasterApplicationBootstrapImpl.class );
        ...
	@PostConstruct @Transactional
       	public synchronized void start() throws Exception {
                // [WORKS] Uses SLF4J API: the output is present on the log file
		logger2.info("Master Application Bootstrap starting ...");
                // [DOES NOT WORK] Uses OSGi service: nothing is written on the log file
		logger.log( LOG_INFO, "Master Application Bootstrap starting ..." );
                 ...
        }
        ...
}

I simply import the LogService using Spring DM:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd"
	xmlns:osgi="http://www.springframework.org/schema/osgi">
        ...
	<osgi:reference id="logger" interface="org.osgi.service.log.LogService" />
        ...
</beans>


I think that I'm missing something here: should I write by my own LogListener or is there a simpler way in Virgo? Confused

Any tips is higly appreciated! Cool
Re: LogService does nothing [message #665818 is a reply to message #665810] Sat, 16 April 2011 12:57 Go to previous messageGo to next message
Hristo Iliev is currently offline Hristo IlievFriend
Messages: 156
Registered: May 2010
Location: Sofia, Bulgaria
Senior Member

I think the support for OSGi LogService is not yet in place.

There is an enhancement for this already.
Re: LogService does nothing [message #665825 is a reply to message #665818] Sat, 16 April 2011 15:15 Go to previous messageGo to next message
Mario Scalas is currently offline Mario ScalasFriend
Messages: 32
Registered: July 2009
Member
Thanks: I'll have to wait for the final 3.0 to (hopefully) include the feature (and watch the logs!).
Re: LogService does nothing [message #665925 is a reply to message #665825] Mon, 18 April 2011 08:11 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
There are more enhancements than will fit in the 3.0 plan, so we would welcome a patch to implement this.
Previous Topic:Maven repository for Virgo 3.0 milestone?
Next Topic:axis2 virgo and equinox
Goto Forum:
  


Current Time: Fri Dec 06 04:45:10 GMT 2024

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

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

Back to the top