Reputation: 49
I'm trying to learn OSGi for my project, and came across the ExtendedLogService
and ExtendedLogReaderService
which was introduced in Equinox 3.5. Is there any tutorial or example available that would help me to understand how it works and to use it on my project?
Thanx.
Upvotes: 1
Views: 554
Reputation: 781
Well I did not implement the ExtendedLogService, But i do implemented the org.osgi.service.log.LogReaderService
org.osgi.service.log.LogEntry , org.osgi.service.log.LogListener
which i think helpful.
About tutorial i follow this one Logger Tutorial
My view towards the logging feature in OSGi,
Structure of logging in OSGi
I had specifically avoid log4j and slf4j because they don't work on S0A architecture. although there is PaxLogging available which makes log4j is to work on OSGi fied environment,but i think the information of bundles into the log4j property will violets the design pattern. There are many developers who questioned the log4j in OSGified env.
LogListener (LogListnerImpl)
^
|
| Dispatches the LogEvent to LogListner
|
Log Service ---- Send a LogEvent --> LogReaderService (log.jar)
^
|
|
Bundle write a log
===========================================================================
I will appreciate if experienced developers correct me.
Upvotes: 0
Reputation: 19606
I have not yet tried the ExtendedLogService. When looking into the interfaces it looks similar to popular logging frameworks. So the big question is why not just use an established logging API? Using the OSGi logging service will tie all your code to OSGi. The established frameworks work inside and outside OSGi. I can recommand to use slf4j in your application. To make this work in OSGi you need the pax logging framework. Pax logging also supports the other big logging APIs like log4j and java.util.logging. If you are doing a server project then you might also want to take a look at Apache Karaf which already includes pax logging and a lot of other libs.
Upvotes: 1