avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: JDK1.4 logging vs. LogKit
Date Thu, 09 Aug 2001 08:35:39 GMT


> -----Original Message-----
> From: giacomo [mailto:giacomo@apache.org]
> Sent: den 8 augusti 2001 18:09
> To: Avalon Development
> Subject: RE: JDK1.4 logging vs. LogKit
>
>
> I don't really like specifying the LOGLEVEL in the
> component configuration. I think this is something that has to be
> specified at the class instantiating the loggers.

I like it because it allows very fine-grained control over logging levels
and allows for logging configuration for the component manager to be given
in the component manager configuration (and not, as it is now, in a separate
place). I dislike it because it doesn't allow for switching on/off entire
hierarchies of loggers and leads to "paradoxes" as the situation I
described, where the same category has two different logging levels.

I really like the idea of being able switch logging levels for entire
hierarchies - for example, given categories:

  cocoon2
  cocoon2.mytransformer
  cocoon2.mytransformer.mychildlogger
  cocoon2.othercomponent

and the logger config:

  <logger name="cocoon2" level="INFO"/>

all categories would be logging at the INFO level.

But with:

  <logger name="cocoon2" level="INFO">
    <logger name="mytransformer" level="DEBUG">
  </logger>

cocoon2 and cocoon2.othercomponent are at INFO, cocoon2.mytransformer and
cocoon2.mytransformer.mychildlogger are at DEBUG.

This would be specified in the configuration as, for example:

  <components>
    <logger name="cocoon2" level="INFO">
      <logger name="mytransformer" level="DEBUG">
    </logger>
    <component role="..." class="..." logger="cocoon2"/>
    <component role="..." class="..." logger="cocoon2.mytransformer"/>
    .
    .
    .
  </components>

I have this undertaking in my list of stuff that I'd really like to do.
However, I will need to study the behaviour of LogKit and the behaviour of
the component manager in relation to the Logger hierarchy, as well as the
way one specifies logger categories. For example, what if the component
manager above has the category "componentmanager". That would make the fully
qualified names of the cocoon2 logger componentmanager.cocoon2, and so on.

> Do you see yourself
> changing all loglevels in the config file when you deploy it for
> production?

That in itself is no problem and can be automated easily. Replace log levels
with @loglevel.category@ in the config file and use Ant's filtering. I do
this already with host names etc. that differ between development
environment and deployment environment.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message