Thank you for the suggestion. We have had a pretty good discussion about the eclipse case and came to the conclusion that it would not be a good idea to change the service ranking but instead to create a specific Eclipse logger that can catch all the various
Eclipse log events (I think there are three total) and log them to SLF4J. It could depend on this specific LogService via the service query. The Eclipse LogService could then provide a higher service level, even with a Property that would be settable in the
Eclipse prefs.
Osgi-over-slf4j has many places to live other than Eclipse so it needs to play nice across the board. Upping the service ranking in code is definitely not nice.
Hi osgi-over-slf4j developers,
I've tested osgi-over-slf4j 1.7.2 with equinox 3.8 and cannot use the SLF4J LogService because
Equinox register also a LogService with default ranking 0. SLF4J gets also ranking 0 (default ranking)
because no service ranking is explicitly set. Is it OK for you if I introduce ranking = 10 for SLF4J LogService?
If want to commit following change:
Properties props = new Properties();
props.put(Constants.SERVICE_DESCRIPTION, "An SLF4J LogService implementation.");
props.put(Constants.SERVICE_RANKING, 10);
ServiceFactory factory = new LogServiceFactory();
bundleContext.registerService(LogService.class.getName(), factory, props);
to org.slf4j.osgi.logservice.impl.Activator. I also think, that we should made log service ranking configurable ... (via system property for example).
With the above change, I can also see OSGi log messages in Beagle ;-) Thats COOL ...
Christian