cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1301626 - in /cxf/branches/2.4.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
Date Fri, 16 Mar 2012 16:16:58 GMT
Author: ningjiang
Date: Fri Mar 16 16:16:58 2012
New Revision: 1301626

URL: http://svn.apache.org/viewvc?rev=1301626&view=rev
Log:
CXF-4180 revert the patch which has some side effects

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 16 16:16:58 2012
@@ -1,2 +1,2 @@
-/cxf/branches/2.5.x-fixes:1299092,1299637,1299725,1300270,1300343,1300407-1300533,1300536,1300560,1301205,1301549
-/cxf/trunk:1298470,1298830,1298832,1299086,1299635,1299682,1299747,1300342,1300518,1300530,1300555,1301201,1301539
+/cxf/branches/2.5.x-fixes:1299092,1299637,1299725,1300270,1300343,1300407-1300533,1300536,1300560,1301205
+/cxf/trunk:1298470,1298830,1298832,1299086,1299635,1299682,1299747,1300342,1300518,1300530,1300555,1301201

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1301626&r1=1301625&r2=1301626&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
(original)
+++ cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
Fri Mar 16 16:16:58 2012
@@ -96,8 +96,17 @@ public final class LogUtils {
             }
             if (StringUtils.isEmpty(cname)) {
                 Class.forName("org.slf4j.impl.StaticLoggerBinder");
-                // using the Slf4jLogger directly
-                cname = "org.apache.cxf.common.logging.Slf4jLogger";
+                Class<?> cls = Class.forName("org.slf4j.LoggerFactory");
+                Class<?> fcls = cls.getMethod("getILoggerFactory").invoke(null).getClass();
+                if (fcls.getName().contains("Log4j")) {
+                    cname = "org.apache.cxf.common.logging.Log4jLogger";
+                } else if (fcls.getName().contains("JCL")) {
+                    cls = Class.forName("org.apache.commons.logging.LogFactory");
+                    fcls = cls.getMethod("getFactory").invoke(null).getClass();
+                    if (fcls.getName().contains("Log4j")) {
+                        cname = "org.apache.cxf.common.logging.Log4jLogger";
+                    }
+                }
             }
             if (!StringUtils.isEmpty(cname)) {
                 try {



Mime
View raw message