[slf4j-dev] Re: TRACE level

robert burrell donkin robertburrelldonkin at blueyonder.co.uk
Sun Jul 17 23:51:52 CEST 2005


On Fri, 2005-07-08 at 19:05 +0200, Ceki Gülcü wrote:

<snip>

> There are two questions on my mind.
> 
> 1) Is TRACE being used for good reasons?
> 
> 2) Is TRACE being used because the existing APIs do not offer enough
> expressive power?
> 
> It is probably easier to answer the first question because the second
> is open-ended. So, let's focus on the first question if it's OK with
> you.

nope ;)

this thread reminded me about something which relates to both questions.

a few months ago (as a number of you already know) IBM approached apache
with a proposal to extend JCL to address issues common to enterprise
applications (for example, globalisation). part of this involved
discussions about one common use of trace: to be used to allow the
sequence of method calls made in an application to be logged.  

a typical code snippet for this use case is

public void foo() {
   logger.trace("Entering foo");
   ...
   logger.trace("Exiting foo");
}

(it's not just IBM: i've also seen it in other commercial code.)

so [1] is this a good use for TRACE? 

adding new, more expressive methods was discussed [2]. would this have
been a better approach?

a hypothesis strikes me: is the only good reason to have a trace level
is to allow users some flexibility in order to compensate for a failure
of the logging system to address all required use cases expressively?

- robert




More information about the slf4j-dev mailing list