Skip to main content



      Home
Home » Eclipse Projects » Equinox » Configuring the equinox LogService
Configuring the equinox LogService [message #68143] Fri, 26 May 2006 08:52 Go to next message
Eclipse UserFriend
Hello,

The OSGi Service Platform Service Compendium - R4 states that "some
implementations may allow a configurable policy to ignore certain LogEntry
object types". Does Equinox support LogService configuration? If so, how
is the configuration specified? What are the performance implications of
logging LOG_DEBUG messages to LogService? Ideally, I'd like to make
liberal use of LOG_DEBUG during development without significantly
impacting runtime performance in production. Is this possible using
Equinox?

Thanks much,
Cameron.
Re: Configuring the equinox LogService [message #68156 is a reply to message #68143] Fri, 26 May 2006 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi Cameron,

The Equinox LogService implementation (in the org.eclipse.equinox.log
bundle) uses configuration property "log.threshold". You can set this
property to one of the four predefined int values defined by LogService:

LOG_ERROR = 1
LOG_WARNING = 2
LOG_INFO = 3
LOG_DEBUG = 4

For example if you only want messages with a ERROR or WARNING levels
then you would specify the following in your config.ini or as a -D java
argument

log.threshold=2

The default threshold is set to LOG_DEBUG(4)

HTH

Tom
Re: Configuring the equinox LogService [message #68169 is a reply to message #68156] Fri, 26 May 2006 09:34 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Tom... precisely what I was looking for.

So, if I set log.threshold to 3 (i.e. LOG_INFO and above) and I have a
statement like this somewhere in my bundle:
logService.log(LogService.LOG_DEBUG, "some message"), it seems clear that
LogService will disregard the log request. However, what is the residual
runtime cost of this request?

Cheers,
Cameron.
Re: Configuring the equinox LogService [message #68180 is a reply to message #68169] Fri, 26 May 2006 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.kaegi.cognos.com

Hi Cameron,
There's definitely still a cost to all this.
e.g. the residual cost of creating the message and running through all the
logic in the logservice.

I've been working with an SLF4J facade to get around this. (e.g it gives an
isDebug() check and a potentially cheaper debug(...))
I've opened a related bug report but I'm wondering if this is a topic for
broader discussion?
I'm running into these low-level logging issues frequently and it would be a
good thing to set an approach.

-Simon

p.s. I don't think you can set the default threshold by System Property /
config.ini (just Config Admin) but that still seems like a good idea to me.
Opening an enhancement request...


"Cameron Ross" <cross@symboticware.com> wrote in message
news:c8cf37f1a9ae5d1840490f90177fbc74$1@www.eclipse.org...
> Thanks Tom... precisely what I was looking for.
> So, if I set log.threshold to 3 (i.e. LOG_INFO and above) and I have a
> statement like this somewhere in my bundle:
> logService.log(LogService.LOG_DEBUG, "some message"), it seems clear that
> LogService will disregard the log request. However, what is the residual
> runtime cost of this request?
>
> Cheers,
> Cameron.
>
Re: Configuring the equinox LogService [message #68192 is a reply to message #68180] Fri, 26 May 2006 11:21 Go to previous message
Eclipse UserFriend
Thanks Simon,

When I originally answered this post I only glanced at the code, I did
not realize the property was only read from ConfigAdmin. So my original
post was bogus. Sorry about that Cameron. We definitely should be
defaulting to the valud provided by the BundleContext.getProperty.

Tom
Previous Topic:run osgi config error
Next Topic:Exploded OSGi Bundles
Goto Forum:
  


Current Time: Tue Jul 08 02:09:39 EDT 2025

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

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

Back to the top