https://issues.apache.org/bugzilla/show_bug.cgi?id=46426

           Summary: Implement commons-logging interfaces natively in log4j
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=23041)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23041)
Patch to implement the commons-logging interfaces natively in log4j

With the ongoing discussion on whether or not to implement slf4j inside log4j,
it makes IMHO much more sense to integrate the "other" popular logging
component at the ASF directly into log4j.

The most popular pattern in libraries is to use either slf + logging framework
or commons-logging + logging framework. In the case of "log4j" as logging
framework, this is slf4j-log4j + log4j or commons-logging + log4j. 

The ongoing discussion tries to alleviate the first situation by integrating
slf4j into log4j, thus allowing log4j as a direct replacement for all
components that currently use slf4j + logging framework in the log4j case (drop
log4j into the libs folder, remove all other slf4j components and logging
frameworks. Done).

This patch aims at doing the same thing with commons-logging. If this patch
gets applied by log4j, log4j itself is a drop-in replacement for
"commons-logging + log framework", redirecting all log messages from components
using commons-logging directly to log4j. The combo commons-logging + log4j is
probably the most popular combination.

The widespread critique of commons-logging which tries to select its logging
framework at runtime through a combination of reflection and configuration,
which led to the design of slf4j could also be silenced as this is a
non-nonsense concrete implementation of the classes. 

The patch itself is minimal; the included LogFactory class is purely designed
to serve the most common patterns of commons-logging usage, which is 

private static final Log log = LogFactory.getLog(classname.class);
private static final Log log = LogFactory.getLog("mylogger");
protected final Log log = LogFactory.getLog(this.getClass());
protected final Log log = LogFactory.getLog("mylogger");

these four patterns are the vast majority of all commons-logging uses.

Please apply the attached patch. This bug report is not meant as a joke.

Thanks
    Henning


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to