logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Sitze" <rsi...@us.ibm.com>
Subject Re: Common Logging Interface
Date Wed, 07 Nov 2001 18:32:13 GMT
Berin, I cannot help but feel you are missing my point...  Perhaps I'm
missing yours.  Read on...

Berin Loritsch wrote:
>Richard Sitze wrote:
>> I was going to break a rule, and cross post to two different groups...
>> I cannot find an Avalon group.  So I've added a few of the major LogKit
>> contributors, in addition to Berin (thanks for your comments to date
>> Berin!).
>> OK, so LogKit has the abstraction (interface), but it's not yet inline
>> Log4J.  My overriding goal remains choice: I WANT CHOICE of a pluggable
>> was podium pounding, not yelling :-)  In addition, I need a factory
>> interface to properly abstract initialization.  See history (below) of
>> note..
>Avalon Framework has the interface.
>As to being "inline" with Log4J, the interface merely has the client part
>the Logger interface.  Anything else is too much.  You can't guarantee the
>same API for setting up and configuring Logging implementations.  Nor
>you.  Can you give more info on being "inline" with Log4J?

I want a common interface that is *implemented* (as in Java 'class MyLogger
implements commonLogger') by both the LogKit Logger and the Log4J
Category/Logger classes.

For LogKit this means the framework logger interface 'extends' the common
interface, and adds its own special requirements...  The Logger class
already extends the framework interface, which is goodness.  Your interface
is an excellent starting point!

For Log4J this means that the Category/Logger classes 'implement' the
common interface.

Now, for this to occur there are going to be changes to the classes, which
is what I describe below.

>Avalon Framework does give you the choice of which Logging implementation

Yes, as wrappers.  One of the major hangups we keep stumbling into is that
we end up with wrappers of wrappers of wrappers...  We have two code bases
that are SO close to a common interface, which has 0 (zero) overhead if a
'implements' the interface, rather than wrapping to another interface.

>> Choice is important (this is open-source, remember!) to minimize
>> configuration points and multiple log files in an enterprise application
>> (multiple middleware solutions, multiple applications, all trying to
>> together.. in a distributed environment..).  See history (below) for
>> details..
>> Finally, I believe that the changes are minimal.
>> To repeat earlier points and address the new LogKit interface, the
>> differences that I see between LogKit and Log4J are:
>> a.  LogKit::fatalError versus Log4J::fatal.
>Using the Avalon Framework Logger interface, they both become
>In fact it also works for JSR47::serious().

wrappers... not good enough :-)

>> b.  Log4J lacks isXXXEnabled() methods.  I would prefer not to introduce
>> isEnabled(Level) method to the interface, and I understand that JSR47
>> not be able to implement the interface directly, but will require a
>> wrapper.
>The Avalon Framework Logger interface has the isXXXEnabled() methods
accross the
>board.  For the ones not available in Log4J, the wrapper uses the

Which is why you didn't see me proposing a change for LogKit on this point

>> c.  LogKit parameters are java.lang.String, whereas Log4J uses
>> java.lang.Object.
>Do you _really_ every log anything else other than strings?  For objects,
you would
>simply perform a Object.toString() on it.

In practice, I don't care.  However, moving Log4J to java.lang.String is
going to be harder than (for backwards compatibility) than moving LogKit to
an object.

>> d.  LogKit org.apache.avalon.framework.logger.Logger interface
>> getChildLogger(String name)
>The default implementation for the Log Tools that don't support the notion
>of Child Loggers (instead of ParentLoggers), we use dot notation for the
>return Category.getInstance(logger.getName() + "." + childName);
>So you still have the same effective interface.

I agree.  Once we have a simple interface there are many obvious
extensions...  but I want to address the core problem first.  In light of
your example I would not be adverse to a 'getName()' method in the common

>> I'm willing to do the work to establish a common logging interface, but
>> must be coordinated.  Clearly I need to know that it's going to be
>> before I start.  To make this happen, I need a coordinated VOTE from:
>> A.  Apache/Jakarta development leaders (common code?)
>> B.  Log4J development team (I can do work, I need support).
>> C.  LogKit development team (again, I'd be happy to do work, but I need
>> support).
>> For Apache/Jakarta common code (craig, can you help with logistics
>> I propose the following (I'm not attached to names):
>>      Apache.1: Copy the org.apache.avalon.framework.logger.Logger
>>                interface to org.apache.common.logger.Logger (?).
>If this happens, make the package name shorter.  Honestly, I like the
>Logger package, and I do not want something that exposes the whole Logger

I'm trying to abstract the hierarchy and the avalon framework...
If you want LogKit - use it.  What I'm trying to do is 'enable' those who
want a pluggable solution that works DIRECTLY with Log4J and LogKit, but
also supports wrappers for other solutions.

>>      Apache.2: Remove getChildLogger(String name) from
>> org.apache.common.logger.Logger.
>-10.  It is common in Avalon programming to get a child logger and hand it
>      to a group of Components that the Container is managing.  It makes
>      interface simple, and keeps the child from circumventing the
>      of Control principles that Avalon is designed around.

I'm removing from the org.apache.common.logger.Logger, but leaving it in
org.apache.avalon.framework.logger.Logger.  That should satisfy your

>>      Apache.3: Change logging method parameters from java.lang.String
>>                to java.lang.Object.
>-0  Honestly, in the end, you are logging Strings.  Period.  If you really
>    to "log" Objects, knock yourself out.

See above.

>>      Apache.4: More to come on factory, but that's incidental if I can
>>                all of this done first.
>Avalon Excalibur has a LogKit Factory that is both powerful and easy to
>It can be modified to allow multiple Log tools relatively easily.

Terrific, can we use it as a basis...

>> I propose that the LogKit group VOTE on the following (as a unit)
>> to the org.apache.avalon.framework.logger.Logger interface:
>>      LogKit.1: Cause interface to extend
>This is possible.
>>      LogKit.2: Remove logging methods in common with
>>                 org.apache.common.logger.Logger (they inherit..).
>>                 This effectively changes parameter types from
>>                 java.lang.String to java.lang.Object, which should
>>                 be backward compatible.
>>      LogKit.3: Leave getChildLogger(String name) as a method unique
>>                 to the framework...
>Honestly, if you get different loggers another way I don't like it.
>The reason being is that you open yourself up to Spoofing attacks
>if you have code that automatically loads and uses components.  If
>you get a rogue component that wants to retrieve Logging calls from
>the rest of the system, it has access to the whole logging heirarchy.
>This is not good.  Bear in mind that Logging has alot of precious
>information that a Hacker can use to determine weaknesses in a system.
>I prefer a system that minimizes the impact of such rogue Components
>as possible.  This is critical in a server framework which Avalon caims
>to be.

I believe I can spoof Log4J simply by adjusting configuration files and
adding my own handlers to the path... I imagine something similar can be
done with LogKit.  what am I missing here?

>"Those who would trade liberty for
> temporary security deserve neither"
>                - Benjamin Franklin


To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>

View raw message