logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: Redirecting Log4j2 to SLF4J?
Date Wed, 02 Jan 2013 17:39:00 GMT

On Jan 2, 2013, at 8:53 AM, Robert Elliot wrote:

> Hi,
> I've been browsing the Log4j2 site, and the documentation is unsurprisingly very focussed
on people using the Log4j2 API directly. Given the profile of Apache & Log4j as brands
this means we will almost certainly very soon see libraries logging directly to the Log4j2
API (whether this is the intent of the committers or not). Which means that application writers
will soon need to manage the log messages from those libraries as those libraries are brought
in to their applications, directly or by transitive dependencies.
> Currently SLF4J provides means to redirect java.util.logging, Log4j and Commons Logging
to SLF4J, and thankfully Logback doesn't encourage clients to use its API directly, making
SLF4J the simplest means for centralising the diverse logging APIs in use to a single implementation
of my own choice.
> I see there is a way to make Log4j2 an SLF4J implementation, but I could not see any
documentation on redirecting Log4j2 to SLF4J in the event that the end application does not
wish to use Log4j2 as its logging implentation. Is this on the cards?

You didn't ask this, but the intent of separating the Log4j 2 APi from the impl is not to
create another generic API to compete with SLF4J.  However, the Log4j 2 API contains more
features than are available in SLF4J (mainly Messages), so I would expect some loss of functionality
and/or performance in a bridge like this.  I haven't spent any time looking into what it would
take to implement the SLF4J bridge as I expected that would be part of the SLF4J offering.
 That said, my guess is that SLF4J could be treated as an alternate Log4j 2 implementation.
 I'll add that to my list of things to do and if it works out I'd probably donate it to SLF4J.


To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message