[jsword-devel] Loggers
DM Smith
dmsmith at crosswire.org
Tue Feb 5 16:04:34 MST 2013
On Feb 5, 2013, at 3:37 PM, Chris Burrell <chris at burrell.me.uk> wrote:
> Hi
>
> I was doing a bit of performance tuning for STEP earlier, to see how I could speed up some of the searches. I found that possibly up to 10% of the time could be spent logging.
Seem strange that 10 percent of the time is managing errors. (You need to look into configuring the logger to only log errors, if you aren't already). Then the calls to logger are lightweight. Pretty much a no-op.
There's a bug in changing the LogLevel and in specifying the logger config. But I don't remember.
>
> I'm guessing that's because of the bit that tries to throw an Exception to capture the stack trace.
We want that when we are handling errors. Maybe we don't want to do it for all levels of logging. I.e. configure it.
See the "showLocation" part of the getLogger() call.
>
> Is there any reason why we're not using the java loggers directly?
We are using the java loggers. We don't use it directly since we were using a different logger before the java loggers.
> Or why we're not using log4j (i see there's a not about keeping it small)
That's what we were using.
The philosophy of JSword architecture is to:
define an abstract interface
create a basic implementation of the abstraction
use a plugin to define which implementation is being used. (Not used wrt logging)
By hiding behind the concrete abstraction, we were able to swap out implementations.
Hope this helps,
DM
More information about the jsword-devel
mailing list