Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE8E9F5E0 for ; Fri, 22 Mar 2013 10:51:17 +0000 (UTC) Received: (qmail 99295 invoked by uid 500); 22 Mar 2013 10:51:17 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 99120 invoked by uid 500); 22 Mar 2013 10:51:17 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 99026 invoked by uid 99); 22 Mar 2013 10:51:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 10:51:15 +0000 Date: Fri, 22 Mar 2013 10:51:15 +0000 (UTC) From: "Hudson (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-3988) Commons Logging may not work in XWork from issue WW-3959 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-3988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13610122#comment-13610122 ] Hudson commented on WW-3988: ---------------------------- Integrated in Struts2-JDK6 #673 (See [https://builds.apache.org/job/Struts2-JDK6/673/]) WW-3988 Changes order of looking for LoggerFactory, first trying to use commons-logging (Revision 1459689) Result = SUCCESS lukaszlenart : Files : * /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/logging/LoggerFactory.java > Commons Logging may not work in XWork from issue WW-3959 > -------------------------------------------------------- > > Key: WW-3988 > URL: https://issues.apache.org/jira/browse/WW-3988 > Project: Struts 2 > Issue Type: Bug > Components: Integration > Affects Versions: 2.3.12 > Reporter: Erik Berg > Labels: logging, slf4j, xwork > Fix For: 2.3.13 > > > Support for SLF4J in XWork added in WW-3959 can break Commons Logging since it looks for SLF4J in the classpath first. If found, it assumes Struts/XWork is configured to use SLF4J and creates an SLF4J log factory. > The problem with this approach is that other libraries in a web application may have a dependency on SLF4J, hence it is found in the classpath, even when it is not configured as the logging factory for Struts. > {code:title=LoggerFactory.java|borderStyle=dashed} > Index: LoggerFactory.java > =================================================================== > --- LoggerFactory.java (revision 911280) > +++ LoggerFactory.java (revision 1431482) > @@ -16,6 +16,7 @@ > package com.opensymphony.xwork2.util.logging; > > import com.opensymphony.xwork2.util.logging.jdk.JdkLoggerFactory; > +import com.opensymphony.xwork2.util.logging.slf4j.Slf4jLoggerFactory; > > import java.util.concurrent.locks.ReadWriteLock; > import java.util.concurrent.locks.ReentrantReadWriteLock; > @@ -59,11 +60,17 @@ > try { > if (factory == null) { > try { > - Class.forName("org.apache.commons.logging.LogFactory"); > - factory = new com.opensymphony.xwork2.util.logging.commons.CommonsLoggerFactory(); > + Class.forName("org.slf4j.LoggerFactory"); > + factory = new Slf4jLoggerFactory(); > } catch (ClassNotFoundException ex) { > - // commons logging not found, falling back to jdk logging > - factory = new JdkLoggerFactory(); > + //slf4j not found try commons LogFactory > + try { > + Class.forName("org.apache.commons.logging.LogFactory"); > + factory = new com.opensymphony.xwork2.util.logging.commons.CommonsLoggerFactory(); > + } catch (ClassNotFoundException cnfex) { > + // commons logging not found, falling back to jdk logging > + factory = new JdkLoggerFactory(); > + } > } > } > return factory; > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira