Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » How to do logging in Riena?
How to do logging in Riena? [message #24868] Tue, 28 April 2009 15:47 Go to next message
Eclipse UserFriend
Originally posted by: kessels.sjoerd.gmail.com

Hi,

I am new to Riena. I have read bits and pieces on Riena and logging, and I
see there is stuff in the framework for it, but I don't get it yet. Could
someone give, or point me to, a description on how logging in Riena works?

F.e. In my RienaPlugin (on the server) I can call getLogger. Where do I find
the loglevels to provide as parameters? Where does it log to and how can I
configure this?
I see extension points for Log catchers and listeners but there is no
documentation on what they do and how to use.

Thanks,

Sjoerd Kessels
Re: How to do logging in Riena? [message #24900 is a reply to message #24868] Wed, 29 April 2009 06:24 Go to previous message
Stefan Liebig is currently offline Stefan LiebigFriend
Messages: 124
Registered: July 2009
Senior Member
Hi Sjoerd,

Yes, you are right there should be more documentation.
I will sketch shortly how we do logging:
1. Riena uses the ´extended´ logging of OSGi which just has graduated
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=260672). This means that
Riena uses the log levels defined in org.osgi.service.log.LogService.
2. Riena offers support to ease the usage of logging:
- getting a logger for class:
private static final Logger LOGGER =
Log4r.getLogger(Activator.getDefault(), YourClass.class);
- using this logger:
LOGGER.log(LogService.LOG_WARNING, "Your warning");
With that logging will be send to the logging service and if no
listeners are defined nothing will logged.
3. Log listners. There is an extension point for defining log listeners
"org.eclipse.riena.core.logging.listeners" where you can define log
listeners and log filters. Log filters decide whether to log or not.
Riena has a few predefined log listeners and log filters, e.g.
Log4jLogListener and SystemPropertyLogFilter. In plugin.xml (riena.core)
there is a examplary definition (in comments) for this extension point.
4. Log Catchers. Log catchers offer the possibility to attach to certain
´log´ event sources and route them to the OSGi logging. E.g. it possible
to attach to the standard java logging with the JavaLogCatcher which
´listens´ to Java logging events and delegates that to the OSGi logging.
The extension point is "org.eclipse.riena.core.logging.catchers" and
exemplary definitions are in plugin.xml (riena.core).

However, you can use Riena´s logging support or use any other logging
flavor that suit your needs. If you use something else and you also want
to get the logging events that Riena produces you have to listen to
´extended´ logging service of OSGi and delegate that to your logging.

HTH

Tschüß,
Stefan



Sjoerd Kessels wrote:
> Hi,
>
> I am new to Riena. I have read bits and pieces on Riena and logging, and
> I see there is stuff in the framework for it, but I don't get it yet.
> Could someone give, or point me to, a description on how logging in
> Riena works?
>
> F.e. In my RienaPlugin (on the server) I can call getLogger. Where do I
> find the loglevels to provide as parameters? Where does it log to and
> how can I configure this?
> I see extension points for Log catchers and listeners but there is no
> documentation on what they do and how to use.
>
> Thanks,
>
> Sjoerd Kessels
Re: How to do logging in Riena? [message #582004 is a reply to message #24868] Wed, 29 April 2009 06:24 Go to previous message
Stefan Liebig is currently offline Stefan LiebigFriend
Messages: 124
Registered: July 2009
Senior Member
Hi Sjoerd,

Yes, you are right there should be more documentation.
I will sketch shortly how we do logging:
1. Riena uses the ´extended´ logging of OSGi which just has graduated
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=260672). This means that
Riena uses the log levels defined in org.osgi.service.log.LogService.
2. Riena offers support to ease the usage of logging:
- getting a logger for class:
private static final Logger LOGGER =
Log4r.getLogger(Activator.getDefault(), YourClass.class);
- using this logger:
LOGGER.log(LogService.LOG_WARNING, "Your warning");
With that logging will be send to the logging service and if no
listeners are defined nothing will logged.
3. Log listners. There is an extension point for defining log listeners
"org.eclipse.riena.core.logging.listeners" where you can define log
listeners and log filters. Log filters decide whether to log or not.
Riena has a few predefined log listeners and log filters, e.g.
Log4jLogListener and SystemPropertyLogFilter. In plugin.xml (riena.core)
there is a examplary definition (in comments) for this extension point.
4. Log Catchers. Log catchers offer the possibility to attach to certain
´log´ event sources and route them to the OSGi logging. E.g. it possible
to attach to the standard java logging with the JavaLogCatcher which
´listens´ to Java logging events and delegates that to the OSGi logging.
The extension point is "org.eclipse.riena.core.logging.catchers" and
exemplary definitions are in plugin.xml (riena.core).

However, you can use Riena´s logging support or use any other logging
flavor that suit your needs. If you use something else and you also want
to get the logging events that Riena produces you have to listen to
´extended´ logging service of OSGi and delegate that to your logging.

HTH

Tschüß,
Stefan



Sjoerd Kessels wrote:
> Hi,
>
> I am new to Riena. I have read bits and pieces on Riena and logging, and
> I see there is stuff in the framework for it, but I don't get it yet.
> Could someone give, or point me to, a description on how logging in
> Riena works?
>
> F.e. In my RienaPlugin (on the server) I can call getLogger. Where do I
> find the loglevels to provide as parameters? Where does it log to and
> how can I configure this?
> I see extension points for Log catchers and listeners but there is no
> documentation on what they do and how to use.
>
> Thanks,
>
> Sjoerd Kessels
Previous Topic:How to do logging in Riena?
Next Topic:MasterDetailComposite
Goto Forum:
  


Current Time: Fri Apr 26 20:01:02 GMT 2024

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

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

Back to the top