[slf4j-dev] discussion about LogService ranking in osgi-over-slf4j

Matthew Bishop Matthew.Bishop at elasticpath.com
Tue Oct 23 21:00:46 CEST 2012


Hi Christian,

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.

Matt


From: Christian Trutz <christian.trutz at belaso.de<mailto:christian.trutz at belaso.de>>
Reply-To: slf4j developers list <slf4j-dev at qos.ch<mailto:slf4j-dev at qos.ch>>
Date: Tuesday, 23 October, 2012 11:05 AM
To: "slf4j-dev at qos.ch<mailto:slf4j-dev at qos.ch>" <slf4j-dev at qos.ch<mailto:slf4j-dev at qos.ch>>
Subject: [slf4j-dev] discussion about LogService ranking in osgi-over-slf4j

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

[http://elasticpath.com/images/ep.gif]
Matthew Bishop, Senior Architect
Phone: 604.408.8078 ext. 101
Email: Matthew.Bishop at elasticpath.com<mailto:Matthew.Bishop at elasticpath.com>

Elastic Path Software, Inc.
Web elasticpath.com <http://www.elasticpath.com/> | Blog getelastic.com <http://www.getelastic.com/> | Twitter twitter.com/elasticpath <http://www.twitter.com/elasticpath>
Careers elasticpath.com/jobs<http://www.elasticpath.com/jobs> | Community grep.elasticpath.com <http://grep.elasticpath.com/>

Confidentiality Notice: This message is intended only for the use of the designated addressee(s), and may contain information that is privileged, confidential and exempt from disclosure. Any unauthorized viewing, disclosure, copying, distribution or use of information contained in this e-mail is prohibited and may be unlawful. If you received this e-mail in error, please reply to the sender immediately to inform us you are not the intended recipient and delete the email from your computer system.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-dev/attachments/20121023/f40f80e5/attachment.html>


More information about the slf4j-dev mailing list