[slf4j-dev] Re: TRACE level

Endre Stølsvik Endre at Stolsvik.com
Wed Jul 6 13:29:00 CEST 2005


On Tue, 5 Jul 2005, Greg Wilkins wrote:

| Ceki,
| 
| Very good point about the different type of warnings.  
| I'm coming around to the marker mind set.
| 
| As niclas says, it is a 2D space of logs, where
| one axis is fixed by the log system:  debug,info,warn,error
| and the other axis is controlled by the developer and is
| arbitrary.
| 
| In fact, thinking of it in that way is a good reason to only
| have 2D and not 3D logging.
| 
| I can now see things like:
| 
|    log.error(LogSupport.FATAL,"shit happened",e);
|    log.error(LogSupport.TRANSIENT,"try again",e);
| 
|    log.warn(LogSupport.SECURITY,"Break in attempt on port {}",port);
|    
|    log.debug(LogSupport.TRACE,"entered method and too lazy to use IDE");
|    log.debug(LogSupport.VERBOSE,"{}",bigObject);

Isn't this exactly 3 axis, thou'?

  log <- 1st axis, as the Logger instance is attached to the category 
            hierarchy
  .warn <- 2nd axis, the "verbosity and production/debug" axis
  (LogSupport.SECURITY ..  <- 3rd axis, the "domain"/"marker" axis.

I think the first and thrid may be merged - let one logger be attached to 
multiple spots in the category-hierarchy instead of introducing a new 
concept, fitting along yet another (possibly redundant) axis.

Come to think more about it, I think all of them could be merged! Just let 
one branch of the category-hierarchy be named "LEVEL", "VERBOSITY" or 
"SEVERITY", and have sub-categories error, warn, info, debug, trace and 
whatnot. User configurable.
  Configuration would be hell, though - One would need some logic rule 
language like "if logevent is SECURITY && ( WARN || ERROR ) append-to 
SecurityAppender", even for the very common axis that "LEVEL" is: 
Basically all rules in the entire log configuration file would need the 
"&& SOME_LEVEL" qualifyer.
  The main problem with the verbosity axis, is that it is -so extremely 
common- that it acutally deserves its own position in the API (which it 
now has). However, one may argue for ages how many "leaves" or "ticks" 
this axis should have. And as of now, it lacks one on the verbose side! ;)

  (Another slight problem is the threshold - configuring a logger for 
some threshold will affect events on that level -and all below-. The 
"precedence" or whatever its called is not that easy to configure within 
the categories-hierarchy.)

Endre.



More information about the slf4j-dev mailing list