[slf4j-dev] Beta 4 and the new method signatures

Endre Stølsvik Endre at Stolsvik.com
Thu Jul 7 14:16:12 CEST 2005


On Thu, 7 Jul 2005, Niclas Hedhman wrote:

| 
| > Basically, you suggest having -two- separate axis-aspects, then?
| >
| > The first is still the Logger's "name" (or "category), and the second is
| > this multi-dimensional Axis-thing, right? That they both have "getName()"
| > is a give-away, kinda..!
| 
| > Why couldn't the axis-thing be merged back into the category-tree,
| > instead? See, each axis here could simply be viewed as a separate (main,
| > top) branch of the one category tree, and its branches again are the
| > elements (colors, levels).
| >   You then allow for one Logger to be attached to multiple spots in this
| > resulting tree.
| 
| I.e. There is only N Axes and each Logger becomes the end-point for the API 
| user into each of those axes. Meaning the "Category Tree" is one Axis, 
| possibly some default to make life easier.
| 
| > What is the main benefit of having a separate Axis-aspect taking care of
| > the "multitude" of such attachments?
| 
| Not sure I understand what you mean?

You could instead attach the single Logger to multiple -names- or 
-categories-, read on ..

| 
| > How do you set part of the system in debug mode? You'd have to go on the
| > category-name, right? (See, I -like- the "Category" idea. One have a
| > Logger, and that Logger has a (or several) Category it logs to.).
| 
| I think the paranthesis + the stuff further up are basically saying; "Why not 
| use Category as a name instead of Axis?".

"Category" is what log4j formerly called the Logger, it was its name. I 
find that still an interesting name for the name of a Logger. A Logger is 
instantiated with a name, right? This is a dotty-name. This makes a 
hierarchy. This is a hierarchy of -categories- of log statements, they 
-categorize- the log statements.

Okay, now, if you could just let a Logger have several names, or 
basically, be attached to several categories, then you -could- 
theoretically collapse all the axes down to -one-: the category tree.

You'd only need methods for attaching a Logger to multiple categories, AND 
some configurational logic-language for when and where to append a given 
log-entry.

But then I state that the -level- is of such a fundamental level that I 
feel that it should be "contractual", and NOT free-form. This is really 
beside the collapsing-discussion, though, it is just a personal opinion.


With this opinion in mind, you'd end up with two distinct axes: the level 
axis, and the category-tree, which can be viewed upon as a N-axed system 
if you're inclined to look at it that way, where N is unlimited! Thus it 
should suffice for every need..

One may thus make rules like now:

ROOT.Http.Handler: set threshold to INFO 
   -> Appender 1 (http_handler.log)

ROOT.Http.Handler.Parser: set threshold to TRACE  ;-)
   -> Appender 2 (testlog.log)

and so on..

BUT you could also make rules like

If logevent on ROOT.Http.Handler && ROOT.LocalIP
  -> Appender 3 (local_http_handlings.log)

which would only log an event to Appender 3 if it was entered with a 
Logger that is attached to both ROOT.Http.Handler (or lower) and 
ROOT.LocalIP (or lower).
  What to do with the level-thresholds at this point I'm not too sure 
about, either one could ignore them, or the event would have to pass the 
threshold of both (all) the categories, or just pass one of them, or this 
could be configurable within the rule, even down to each category 
mentioned within the rule??

See, this is just an idea, but I find it -interesting- at least!

| 
| I think you somehow missed the point. The developer do Nothing! No axes, no 
| colors, no levels, no nothing. The people (sometimes the developer) who 
| consumes the logging output, sets up the N-dimensional system to their 
| liking. No programming and no configuration, is what I had in mind.

I think I follow you! But one must first solve the problem of where to get 
the loggers from, in what way, what and how they should be named, and THEN 
one would have the huge problem: I download Tomcat. It apparently has 
twice the Loggers (categories) as it has classes. How do I configure 
this?!

| 
| But as I said, I wonder if we should continue this discussion at all, since I 
| feel it far outside the scope of SLF4J. WDYT?

The number-of-axes discussion must at least continue!

Regards,
Endre.



More information about the slf4j-dev mailing list