How to use Equiniox's LogService ? [message #78003] |
Mon, 27 November 2006 09:46  |
Eclipse User |
|
|
|
Originally posted by: barrya.us.ibm.com
I'm looking for a simple example of the LogService usage, I've seen the
LogService interface, but no mention of anything that implements it.
Thanks,
Barry
|
|
|
Re: How to use Equiniox's LogService ? [message #78019 is a reply to message #78003] |
Mon, 27 November 2006 11:00   |
Eclipse User |
|
|
|
Originally posted by: tonimenzel.gmx.de
Hi Barry,
I've just experimented with the log service.
You can access the service like any other service using the api:
---
ServiceReference logger[] =
context.getServiceReferences(org.osgi.service.log.LogService .class.getName(),null);
LogService logger = (LogService)context.getService(logger[0]);
---
To actually "see" somthing you log, you have to implement a LogReader,
to listen for log-events and do something with it (fowarding to a
log4j,database or just System.out)
I've experimented with the latter one.
You may want to look at this (pretty simple bundle):
http://www.razor-m.de/logdump.zip
This is the logdump-service which dumps every log-event to the
System.out Stream.
have fun,
Toni
To explain the basic concept:
Barry Atkins schrieb:
> I'm looking for a simple example of the LogService usage, I've seen the
> LogService interface, but no mention of anything that implements it.
>
> Thanks,
> Barry
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03992 seconds