[slf4j-dev] TRACE level

Ceki Gülcü listid at qos.ch
Thu Jun 30 21:37:44 CEST 2005


I've been looking at Jboss source code and failed to discover a
convincing use case of the trace(Object) method, other than the
ignore() exception use case previously described by Greg.

Why JBoss? Because, it's open source and uses a Logger class with a
trace(Object) method. Actually, any open source project using
loggers with trace() method would do. In particular, any os project using
JCL would qualify.

trace() without debug()
=======================

In some JBoss classes, e.g. org.jboss.util.stream.Streams, the trace()
method is invoked without ever invoking debug(). It follows that by
default, there is no log output generated by this class.

However, the same effect could have been achieved by having the
Streams class invoke debug() and by setting the level of the
org.jboss.util.stream.Streams logger to INFO or higher.

I consider this particular use of the trace() method as incorrect
because it reinvents core functionality offered by the logging system.

Other classes following the same pattern:

org.jboss.util.threadpool.RunnableTaskWrapper
org.jboss.net.protocol.njar.Handler
org.jboss.net.protocol.resource.ResourceURLConnection
org.jboss.net.protocol.URLStreamHandlerFactory
org.jboss.util.propertyeditor.PropertyEditors
org.jboss.util.state.StateMachine

There are many other classes in the Jboss code with this pattern. With
rare exceptions, it seems that when a Jboss' use of the trace() method
is limited to this pattern.

trace() and debug() in the same class
=====================================

Where are the classes with invocations of both trace() and debug()?
Such classes could demonstrate a meaningful use case for trace().


<request>

   Can anyone think of a class which makes uses of both trace() and
   debug()? If so, could you please provide a URL?

</request>



-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/





More information about the slf4j-dev mailing list