commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [logging] log4j 1.3 support
Date Sun, 02 Oct 2005 17:16:38 GMT
Simon Kitching wrote:

> In Log4J1.2, Level extends Priority and Logger extends Category.
> The log method on Category only takes Priority parameters.
> So any calls to the log method resolves to a method on a Category
> instance that takes a Priority parameter, even when the source code is
> invoking the method on a reference of type Logger and passing a
> parameter of type Level. [1]
> In Log4J1.3, Priority extends Level, and all the constants on the
> Priority class are actually of type Level.
> The result is that no code compiled against 1.2 will run with 1.3 at
> runtime. And that no code compiled against 1.3 will run with 1.2 at
> runtime.
> If you *can* find a way to write one logger class that (compiled against
> either version) will run against both libs that would be great - but
> please *test* that after compiling your code (against either library) it
> works at runtime with either lib version in the classpath. I've spent
> some time thinking about this and believe it can't be done.


You can do something like this with reflection, but this might impact the
performance and has consequences for secure environments :(

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message