Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AE2595A1 for ; Fri, 16 Mar 2012 16:17:37 +0000 (UTC) Received: (qmail 13147 invoked by uid 500); 16 Mar 2012 16:17:37 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 13070 invoked by uid 500); 16 Mar 2012 16:17:37 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 13063 invoked by uid 99); 16 Mar 2012 16:17:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2012 16:17:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2012 16:17:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 52F2F23889FA; Fri, 16 Mar 2012 16:17:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1301627 - in /cxf/branches/2.5.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Date: Fri, 16 Mar 2012 16:17:12 -0000 To: commits@cxf.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120316161712.52F2F23889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ningjiang Date: Fri Mar 16 16:17:11 2012 New Revision: 1301627 URL: http://svn.apache.org/viewvc?rev=1301627&view=rev Log: CXF-4180 revert the patch which has some side effects Modified: cxf/branches/2.5.x-fixes/ (props changed) cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Propchange: cxf/branches/2.5.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.5.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1301627&r1=1301626&r2=1301627&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java (original) +++ cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Fri Mar 16 16:17:11 2012 @@ -97,8 +97,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 {