At 10:42 28/3/01 +0200, Leo Simons wrote:
>Here's an overview of the current logging setup...
>
>HISTORY
>-------
>Logging is a system level service. As such, Avalon should provide
>this to apps building on top of it. To do so, LogKit (in
>org.apache.log) was written.
actually logkit was written waaaay before I joined Avalon. It was
originally developed for logging in high-performance servlets.
>Recently another logging tool, Log4j, has been added to the
>Jakarta project. Log4j is bigger and has a host of features
>LogKit does not provide. From its FAQ:
>- log4j is optimized for speed.
false - logkit is faster
>- log4j is based on a named category hierarchy.
as is logkit
>- log4j is fail-stop but not reliable.
policy is pluggable in logkit - defaults to log4j behaviour
>- log4j is not restricted to a predefined set of facilities.
nor is logkit
>- Logging behavior can be set at runtime using a configuration
> file. Configuration files can be property files or in XML format.
as can logkit (see server.xml)
>- log4j is designed to handle Java Exceptions from the start.
as is logkit
>- log4j can direct its output to a file, the console, an
> java.io.OutputStream, java.io.Writer,
> a remote server using TCP, a remote Unix Syslog daemon, to a
> remote listener using JMS, to the NT EventLog or even send e-mail.
logkit doesn't have NT, JMS, TCP or DB directly though it would be simple
to add in the future.
>- log4j uses 5 priority levels, namely DEBUG, INFO, WARN, ERROR
> and FATAL.
where did you think log4j got those levels? ;)
>- The format of the log output can be easily changed by
> extending the Layout class.
or the formatter class in logkit
>- The target of the log output as well as the writing strategy
> can be altered by implementations of the Appender interface.
or alternatively LogTarget interface
>- log4j supports multiple output appenders per category.
as does logkit
>- log4j supports internationalization.
-10000
it is not the job of a logging toolkit to internationalize.
>We might add:
>- it has a larger developer/use base.
true - and has a more active developer ;)
>- LogKit is even faster, once the
> if( getLogger().isWarnEnabled() )
> {
> getLogger().warn( "Some " + " expensive " + "string" + "operation" );
> }
> setup has been added and implemented (which I'm sure will happen
> soon, as it's a good idea).
it was faster before that.
>THE ISSUE
>---------
>The question is whether the Jakarta project should keep the two logging
>packages.
>
>Arguments for:
>- LogKit provides the lightweight logging, while Log4j provides the
>heavyweight features. They're to be used for different purposes. Thus,
>the separation is good.
>
> The APIs are quite similar. The fact that velocity
> can swap one for the other seems to indicate they
> indeed serve much the same purpose. Thoughts?
They do this by creating a 3rd project specific API which can be good -
until you need high-performance or a certain amount of complexity. (Logkit
started out as a wrapper around log4j and then was rewritten to be
independent of it).
> Which design is better is IMHO a matter of taste,
not really - design is a well established field and you can easily discern
better design when applied to a particular domain. Avalon has primary focus
on good design (consider our web-pages talk mainly of aspect orinetated
programming, design patterns, separatiuon of concerns etc)
>- Log4j has many more developers and many more features.
>It could eat LogKit for lunch and still have room for the
>new logkit API in jdk 1.4.
The "features" it has are not always desirable. I would actually like to
reduce the set of features logkit supports (but wont for backwards
compatability).
I mean seriously what is converting arbitrary types to strings,
internationalisation etc got to do with logging aspect? (Answer: nothing)
>MY VIEW
>-------
>When you need to choose between LogKit and log4j, it basically
>comes down to speed (LogKit) versus features (log4j).
can you give an example of a "feature" that log4j has that LogKits doesn't
but should have? (I only know of one which is locking hierarchies with a
switch - thats about 20-30 minutes work thou).
Cheers,
Pete
*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof." |
| - John Kenneth Galbraith |
*-----------------------------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]