web-dev-qa-db-fra.com

Comment désactiver les messages DEBUG de la journalisation Spring?

Je travaille sur une simple application de bureau (pas une application Web).

Voici mon log4j.properties:

log4j.rootCategory=INFO, stdout

log4j.appender.stdout=org.Apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.Apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{2}:%L $$$$ %m%n

log4j.logger.org.springframework=ERROR,stdout

Comme vous pouvez le voir, afin d'éliminer les messages de journalisation Spring de la console, j'ai essayé cette solution:

Désactiver le journal Spring, pour avoir des journaux lisibles

Lorsque j'appelle log4j logger à partir de mon code, les messages de journalisation sont conformes au modèle spécifié ci-dessus (ce qui est bien).

Cependant, la mauvaise partie est - j'arrive toujours aux messages de niveau DEBUG de la console à partir du printemps ... ils ressemblent ici: Impossible de désactiver les messages de journalisation

Et ils ont un schéma différent. Comme s'ils ignoraient mes paramètres.

J'ai également essayé d'appliquer les suggestions que j'ai trouvées ici:

https://spring.io/blog/2009/12/04/logging-dependencies-in-spring

Dans mon fichier pom:

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
        <scope>runtime</scope>
    </dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>3.2.0.RELEASE</version>
</dependency>

Et pas de SLF4J. Cette option a été mentionnée dans le lien ci-dessus comme une option valide, si je ne me trompe pas.

Que pourrais-je manquer ici?

SORTIE avec -Dlog4j.debug = true

log4j: Trying to find [log4j.xml] using context classloader Sun.misc.Launcher$AppClassLoader@172aa3f.
log4j: Trying to find [log4j.xml] using Sun.misc.Launcher$AppClassLoader@172aa3f class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader Sun.misc.Launcher$AppClassLoader@172aa3f.
log4j: Using URL [file:/C:/Eclipse-workspace/workflow/target/classes/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/Eclipse-workspace/workflow/target/classes/log4j.properties
log4j: Parsing for [root] with value=[INFO, stdout].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p %t %c{2}:%L $$$$ %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing for [org.springframework] with value=[ERROR,stdout].
log4j: Level token is [ERROR].
log4j: Category org.springframework set to ERROR
log4j: Parsing appender named "stdout".
log4j: Appender "stdout" was already parsed.
log4j: Handling log4j.additivity.org.springframework=[null]
log4j: Finished configuring.
23:12:42.763 [main] DEBUG o.s.core.env.StandardEnvironment - Initializing new StandardEnvironment
23:12:42.768 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
23:12:42.769 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
23:12:42.769 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
23:12:42.772 [main] INFO  o.s.c.s.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@7badec: startup date [Thu Feb 13 23:12:42 EST 2014]; root of context hierarchy
23:12:42.809 [main] DEBUG o.s.core.env.StandardEnvironment - Initializing new StandardEnvironment
23:12:42.810 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
23:12:42.810 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
23:12:42.810 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
23:12:42.819 [main] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring-module.xml]
23:12:42.832 [main] DEBUG o.s.b.f.xml.DefaultDocumentLoader - Using JAXP provider [com.Sun.org.Apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
23:12:42.852 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loading schema mappings from [META-INF/spring.schemas]
23:12:42.857 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Loaded schema mappings: {http://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd, http://www.springframework.org/schema/context/spring-context-3.1.xsd=org/springframework/context/config/spring-context-3.1.xsd, http://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd, http://cxf.Apache.org/schemas/configuration/http-conf.xsd=schemas/configuration/http-conf.xsd, http://cxf.Apache.org/configuration/parameterized-types=schemas/configuration/parameterized-types.xsd, http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd=schemas/xmldsig-core-schema.xsd, http://www.springframework.org/schema/security/spring-security-3.0.3.xsd=org/springframework/security/config/spring-security-3.0.3.xsd, http://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://www.springframework.org/schema/security/spring-security-2.0.1.xsd=org/springframework/security/config/spring-security-2.0.1.xsd, http://www.w3.org/2006/07/ws-policy.xsd=schemas/ws-policy-200607.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd=org/springframework/oxm/config/spring-oxm-3.0.xsd, http://www.springframework.org/schema/lang/spring-lang-3.2.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.2.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd=org/springframework/jdbc/config/spring-jdbc-3.1.xsd, http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd, http://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-3.2.xsd=org/springframework/beans/factory/xml/spring-tool-3.2.xsd, http://schemas.xmlsoap.org/ws/2004/08/addressing=schemas/wsdl/addressing.xsd, http://www.springframework.org/schema/jee/spring-jee-3.2.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.springframework.org/schema/security/spring-security-2.0.xsd=org/springframework/security/config/spring-security-2.0.xsd, http://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd=schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd, http://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd, http://www.springframework.org/schema/beans/spring-beans-3.2.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd, http://schemas.xmlsoap.org/wsdl/=schemas/wsdl/wsdl.xsd, http://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd, http://www.springframework.org/schema/lang/spring-lang-3.1.xsd=org/springframework/scripting/config/spring-lang-3.1.xsd, http://www.springframework.org/schema/tx/spring-tx-3.2.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://www.springframework.org/schema/cache/spring-cache-3.1.xsd=org/springframework/cache/config/spring-cache-3.1.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-3.1.xsd=org/springframework/beans/factory/xml/spring-tool-3.1.xsd, http://schemas.xmlsoap.org/wsdl/http/=schemas/wsdl/http.xsd, http://www.springframework.org/schema/jee/spring-jee-3.1.xsd=org/springframework/ejb/config/spring-jee-3.1.xsd, http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd=schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd, http://cxf.Apache.org/schemas/configuration/parameterized-types.xsd=schemas/configuration/parameterized-types.xsd, http://www.springframework.org/schema/task/spring-task-3.2.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/beans/spring-beans-3.1.xsd=org/springframework/beans/factory/xml/spring-beans-3.1.xsd, http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd, http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd, http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.2.xsd, http://www.springframework.org/schema/security/spring-security-2.0.4.xsd=org/springframework/security/config/spring-security-2.0.4.xsd, http://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd, http://www.springframework.org/schema/tx/spring-tx-3.1.xsd=org/springframework/transaction/config/spring-tx-3.1.xsd, http://schemas.xmlsoap.org/wsdl/2003-02-11.xsd=schemas/wsdl/wsdl.xsd, http://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd, http://cxf.Apache.org/schemas/ws/addressing.xsd=schemas/ws-addr-conf.xsd, http://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd, http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd, http://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd, http://www.springframework.org/schema/task/spring-task-3.1.xsd=org/springframework/scheduling/config/spring-task-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd, http://cxf.Apache.org/schemas/wsdl/http-conf.xsd=schemas/wsdl/http-conf.xsd, http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-3.2.xsd, http://www.w3.org/2001/xml.xsd=schemas/xml.xsd, http://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd, http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm.xsd=org/springframework/oxm/config/spring-oxm-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.2.xsd=org/springframework/beans/factory/xml/spring-util-3.2.xsd, http://www.w3.org/2007/02/ws-policy.xsd=schemas/ws-policy-200702.xsd, http://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd, http://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd, http://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd, http://cxf.Apache.org/schemas/policy.xsd=schemas/policy.xsd, http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd=schemas/ws-policy-200409.xsd, http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.2.xsd=org/springframework/oxm/config/spring-oxm-3.2.xsd, http://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd, http://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd, http://www.springframework.org/schema/security/spring-security-3.1.xsd=org/springframework/security/config/spring-security-3.1.xsd, http://cxf.Apache.org/schemas/configuration/cxf-beans.xsd=schemas/configuration/cxf-beans.xsd, http://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd, http://cxf.Apache.org/schemas/core.xsd=schemas/core.xsd, http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-3.2.xsd, http://www.springframework.org/schema/context/spring-context-3.2.xsd=org/springframework/context/config/spring-context-3.2.xsd, http://www.springframework.org/schema/util/spring-util-3.1.xsd=org/springframework/beans/factory/xml/spring-util-3.1.xsd, http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd, http://cxf.Apache.org/schemas/configuration/security.xsd=schemas/configuration/security.xsd, http://www.springframework.org/schema/cache/spring-cache.xsd=org/springframework/cache/config/spring-cache-3.2.xsd, http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-3.2.xsd, http://cxf.Apache.org/schemas/configuration/soap.xsd=schemas/configuration/soap.xsd, http://www.springframework.org/schema/security/spring-security-2.0.2.xsd=org/springframework/security/config/spring-security-2.0.2.xsd, http://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd, http://cxf.Apache.org/schemas/jaxws.xsd=schemas/jaxws.xsd, http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd=org/springframework/oxm/config/spring-oxm-3.1.xsd, http://cxf.Apache.org/schemas/simple.xsd=schemas/simple.xsd, http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd, http://www.springframework.org/schema/security/spring-security.xsd=org/springframework/security/config/spring-security-3.1.xsd, http://www.springframework.org/schema/security/spring-security-3.0.xsd=org/springframework/security/config/spring-security-3.0.xsd, http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd=org/springframework/jdbc/config/spring-jdbc-3.2.xsd, http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-3.2.xsd}
23:12:42.858 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-3.2.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-3.2.xsd
23:12:42.890 [main] DEBUG o.s.b.f.x.DefaultBeanDefinitionDocumentReader - Loading bean definitions
23:12:42.898 [main] INFO  o.s.b.f.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [database/spring-datasource.xml]
23:12:42.899 [main] DEBUG o.s.b.f.xml.DefaultDocumentLoader - Using JAXP provider [com.Sun.org.Apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
23:12:42.901 [main] DEBUG o.s.b.f.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.5.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.5.xsd
23:12:42.911 [main] DEBUG o.s.b.f.x.DefaultBeanDefinitionDocumentReader - Loading bean definitions
.......................

Sortie avec -Dorg.Apache.commons.logging.diagnostics.dest = STDOUT

[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [ENV] Extension directories (Java.ext.dir): null
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [ENV] Application classpath (Java.class.path): C:\Eclipse-workspace\workflow\target\classes;C:\Eclipse-workspace\idm-authentication-service\target\classes;C:\Users\jsmith\.m2\repository\com\ln\idm\product\idm-product-service\1.0-SNAPSHOT\idm-product-service-1.0-SNAPSHOT.jar;C:\Users\jsmith\.m2\repository\com\ln\idm\service\idm-service\1.0-SNAPSHOT\idm-service-1.0-SNAPSHOT.jar;C:\Users\jsmith\.m2\repository\com\ln\idm\domain\idm-internal-api\1.0-SNAPSHOT\idm-internal-api-1.0-SNAPSHOT.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-databinding-xmlbeans\2.7.6\cxf-rt-databinding-xmlbeans-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-api\2.7.6\cxf-api-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\codehaus\woodstox\woodstox-core-asl\4.2.0\woodstox-core-asl-4.2.0.jar;C:\Users\jsmith\.m2\repository\wsdl4j\wsdl4j\1.6.3\wsdl4j-1.6.3.jar;C:\Users\jsmith\.m2\repository\org\Apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-core\2.7.6\cxf-rt-core-2.7.6.jar;C:\Users\jsmith\.m2\repository\com\Sun\xml\bind\jaxb-impl\2.2.6\jaxb-impl-2.2.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\ws\xmlschema\xmlschema-core\2.0.3\xmlschema-core-2.0.3.jar;C:\Users\jsmith\.m2\repository\org\Apache\geronimo\specs\geronimo-javamail_1.4_spec\1.7.1\geronimo-javamail_1.4_spec-1.7.1.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-frontend-simple\2.7.6\cxf-rt-frontend-simple-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-bindings-soap\2.7.6\cxf-rt-bindings-soap-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-databinding-jaxb\2.7.6\cxf-rt-databinding-jaxb-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-frontend-jaxws\2.7.6\cxf-rt-frontend-jaxws-2.7.6.jar;C:\Users\jsmith\.m2\repository\xml-resolver\xml-resolver\1.2\xml-resolver-1.2.jar;C:\Users\jsmith\.m2\repository\asm\asm\3.3.1\asm-3.3.1.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-bindings-xml\2.7.6\cxf-rt-bindings-xml-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-ws-addr\2.7.6\cxf-rt-ws-addr-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-ws-policy\2.7.6\cxf-rt-ws-policy-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\Apache\neethi\neethi\3.0.2\neethi-3.0.2.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-transports-http\2.7.6\cxf-rt-transports-http-2.7.6.jar;C:\Users\jsmith\.m2\repository\org\codehaus\woodstox\woodstox-core-lgpl\4.2.0\woodstox-core-lgpl-4.2.0.jar;C:\Users\jsmith\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\Users\jsmith\.m2\repository\org\codehaus\woodstox\stax2-api\3.1.1\stax2-api-3.1.1.jar;C:\Users\jsmith\.m2\repository\org\Apache\cxf\cxf-rt-ws-security\2.7.6\cxf-rt-ws-security-2.7.6.jar;C:\Users\jsmith\.m2\repository\net\sf\ehcache\ehcache-core\2.5.1\ehcache-core-2.5.1.jar;C:\Users\jsmith\.m2\repository\org\Apache\ws\security\wss4j\1.5.8\wss4j-1.5.8.jar;C:\Users\jsmith\.m2\repository\org\Apache\santuario\xmlsec\1.4.3\xmlsec-1.4.3.jar;C:\Users\jsmith\.m2\repository\xalan\xalan\2.7.1\xalan-2.7.1.jar;C:\Users\jsmith\.m2\repository\xalan\serializer\2.7.1\serializer-2.7.1.jar;C:\Users\jsmith\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\Users\jsmith\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-web\3.2.4.RELEASE\spring-web-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-beans\3.2.4.RELEASE\spring-beans-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-tx\3.2.4.RELEASE\spring-tx-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-orm\3.2.4.RELEASE\spring-orm-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-oxm\3.2.4.RELEASE\spring-oxm-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-test\3.2.4.RELEASE\spring-test-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-mock\2.0.8\spring-mock-2.0.8.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-support\2.0.8\spring-support-2.0.8.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-webmvc\3.2.4.RELEASE\spring-webmvc-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-aspects\3.2.4.RELEASE\spring-aspects-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\aspectj\aspectjweaver\1.7.2\aspectjweaver-1.7.2.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-context-support\3.2.4.RELEASE\spring-context-support-3.2.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\Apache\xbean\xbean-spring\2.8\xbean-spring-2.8.jar;C:\Users\jsmith\.m2\repository\org\springframework\security\spring-security-core\3.1.4.RELEASE\spring-security-core-3.1.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\security\spring-security-web\3.1.4.RELEASE\spring-security-web-3.1.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\security\spring-security-config\3.1.4.RELEASE\spring-security-config-3.1.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\security\spring-security-taglibs\3.1.4.RELEASE\spring-security-taglibs-3.1.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\security\spring-security-acl\3.1.4.RELEASE\spring-security-acl-3.1.4.RELEASE.jar;C:\Users\jsmith\.m2\repository\com\jhlabs\imaging\BLS\imaging-BLS.jar;C:\Users\jsmith\.m2\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;C:\Users\jsmith\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\jsmith\.m2\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;C:\Users\jsmith\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Users\jsmith\.m2\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;C:\Users\jsmith\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Users\jsmith\.m2\repository\commons-lang\commons-lang\2.3\commons-lang-2.3.jar;C:\Users\jsmith\.m2\repository\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;C:\Users\jsmith\.m2\repository\org\mockito\mockito-core\1.9.5\mockito-core-1.9.5.jar;C:\Users\jsmith\.m2\repository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar;C:\Users\jsmith\.m2\repository\org\objenesis\objenesis\2.1\objenesis-2.1.jar;C:\Users\jsmith\.m2\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;C:\Users\jsmith\.m2\repository\jaxen\jaxen\1.1.4\jaxen-1.1.4.jar;C:\Users\jsmith\.m2\repository\org\springmodules\spring-modules-jakarta-commons\0.8\spring-modules-jakarta-commons-0.8.jar;C:\Users\jsmith\.m2\repository\commons-validator\commons-validator\1.1.4\commons-validator-1.1.4.jar;C:\Users\jsmith\.m2\repository\commons-chain\commons-chain\1.1\commons-chain-1.1.jar;C:\Users\jsmith\.m2\repository\javax\portlet\portlet-api\1.0\portlet-api-1.0.jar;C:\Users\jsmith\.m2\repository\myfaces\myfaces-api\1.1.0\myfaces-api-1.1.0.jar;C:\Users\jsmith\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar;C:\Users\jsmith\.m2\repository\commons-el\commons-el\1.0\commons-el-1.0.jar;C:\Users\jsmith\.m2\repository\commons-fileupload\commons-fileupload\1.0\commons-fileupload-1.0.jar;C:\Users\jsmith\.m2\repository\oro\oro\2.0.8\oro-2.0.8.jar;C:\Users\jsmith\.m2\repository\javax\servlet\jstl\1.1.2\jstl-1.1.2.jar;C:\Users\jsmith\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.5\jcl-over-slf4j-1.7.5.jar;C:\Users\jsmith\.m2\repository\org\slf4j\jul-to-slf4j\1.7.5\jul-to-slf4j-1.7.5.jar;C:\Users\jsmith\.m2\repository\ch\qos\logback\logback-classic\1.0.13\logback-classic-1.0.13.jar;C:\Users\jsmith\.m2\repository\ch\qos\logback\logback-core\1.0.13\logback-core-1.0.13.jar;C:\Users\jsmith\.m2\repository\ch\qos\logback\logback-access\1.0.13\logback-access-1.0.13.jar;C:\Eclipse-workspace\idm-verification-service\target\classes;C:\Users\jsmith\.m2\repository\junit\junit\4.4\junit-4.4.jar;C:\Users\jsmith\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\jsmith\.m2\repository\ca\grimoire\log-annotations\1.0\log-annotations-1.0.jar;C:\Users\jsmith\.m2\repository\org\aspectj\aspectjrt\1.6.9\aspectjrt-1.6.9.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-jdbc\3.2.0.RELEASE\spring-jdbc-3.2.0.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-core\3.2.0.RELEASE\spring-core-3.2.0.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-context\3.2.0.RELEASE\spring-context-3.2.0.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-aop\3.2.0.RELEASE\spring-aop-3.2.0.RELEASE.jar;C:\Users\jsmith\.m2\repository\org\springframework\spring-expression\3.2.0.RELEASE\spring-expression-3.2.0.RELEASE.jar;C:\Users\jsmith\.m2\repository\mysql\mysql-connector-Java\5.1.9\mysql-connector-Java-5.1.9.jar;C:\Users\jsmith\.m2\repository\com\google\guava\guava\16.0.1\guava-16.0.1.jar;C:\Users\jsmith\.m2\repository\org\Apache\commons\commons-lang3\3.2.1\commons-lang3-3.2.1.jar
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [ENV] Class org.Apache.commons.logging.LogFactory was loaded via classloader Sun.misc.Launcher$AppClassLoader@26290774
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [ENV] Ancestry of classloader which loaded org.Apache.commons.logging.LogFactory is Sun.misc.Launcher$AppClassLoader@26290774 == 'Sun.misc.Launcher$AppClassLoader@1912a56'
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [ENV] Ancestry of classloader which loaded org.Apache.commons.logging.LogFactory is ClassLoader tree:Sun.misc.Launcher$AppClassLoader@26290774 (SYSTEM)  --> Sun.misc.Launcher$ExtClassLoader@24291903 --> BOOT
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] BOOTSTRAP COMPLETED
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] LogFactory implementation requested for the first time for context classloader Sun.misc.Launcher$AppClassLoader@26290774
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] Sun.misc.Launcher$AppClassLoader@26290774 == 'Sun.misc.Launcher$AppClassLoader@1912a56'
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] ClassLoader tree:Sun.misc.Launcher$AppClassLoader@26290774 (SYSTEM)  --> Sun.misc.Launcher$ExtClassLoader@24291903 --> BOOT
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] No properties file of name 'commons-logging.properties' found.
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] Looking for system property [org.Apache.commons.logging.LogFactory] to define the LogFactory subclass to use...
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] No system property [org.Apache.commons.logging.LogFactory] defined.
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP] Looking for a resource file of name [META-INF/services/org.Apache.commons.logging.LogFactory] to define the LogFactory subclass to use...
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] [LOOKUP]  Creating an instance of LogFactory class org.Apache.commons.logging.impl.SLF4JLogFactory as specified by file 'META-INF/services/org.Apache.commons.logging.LogFactory' which was present in the path of the context classloader.
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] Loaded class org.Apache.commons.logging.impl.SLF4JLogFactory from classloader Sun.misc.Launcher$AppClassLoader@26290774
[LogFactory from Sun.misc.Launcher$AppClassLoader@26290774] Created object org.Apache.commons.logging.impl.SLF4JLogFactory@14185653 to manage classloader Sun.misc.Launcher$AppClassLoader@26290774
09:55:35.705 [main] DEBUG o.s.core.env.StandardEnvironment - Initializing new StandardEnvironment
09:55:35.710 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperties] PropertySource with lowest search precedence
09:55:35.711 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemEnvironment] PropertySource with lowest search precedence
09:55:35.711 [main] DEBUG o.s.core.env.StandardEnvironment - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
09:55:35.714 [main] INFO  o.s.c.s.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d7999e: startup date [Fri Feb 14 09:55:35 EST 2014]; root of context hierarchy
23
rapt

Le printemps utilise commons-logging qui détecte automatiquement le cadre de journalisation à utiliser. Il existe différentes façons de régler quel framework de journalisation sera choisi, donc la première chose à faire est de s'assurer que commons-logging se lie à log4j.

Pour ce faire, démarrez votre application avec un indicateur supplémentaire -Dorg.Apache.commons.logging.diagnostics.dest=STDOUT qui affichera le résultat du processus de découverte.

délégué commun-logging à log4j

Vous devez maintenant vous assurer que log4j est initialisé avec la configuration attendue. Par défaut, log4j recherche un log4j.xml fichier à la racine du chemin de classe et repli sur log4j.properties s'il n'en trouve pas. Il est possible qu'une des bibliothèques que vous utilisez ait (à tort) un log4j.xml fichier à la racine.

Pour déboguer log4j, réexécutez votre application avec un indicateur supplémentaire -Dlog4j.debug=true. Cela affichera les enregistreurs exacts et l'emplacement du fichier de configuration.

commons-logging ne délègue pas à log4j

Si commons-logging ne délègue pas à log4j, cela signifie qu'une autre infrastructure de journalisation est impliquée. Le scénario le plus courant est que votre application est livrée avec jcl-over-slf4j.jar, a remplacement libre of commons-logging qui utilise slf4j Derrière la scène.

Dans ce scénario, Spring utilise commons-logging qui est configuré pour déléguer à slf4j. Donc, essentiellement, Spring utilise slf4j. Mais slf4j est une simple façade de journalisation et nécessite ne liaison à un cadre réel.

DEPUIS 1.6.0 Si aucune liaison n'est trouvée sur le chemin de classe, alors SLF4J passera par défaut à une implémentation sans opération.

Une fois que vous avez trouvé la bibliothèque de liaisons (il peut s'agir de logback ou log4j par exemple), vérifiez la configuration de l'infrastructure de journalisation qui slf4j est lié à.

Dans ce cas particulier, vous avez probablement logback dans votre chemin de classe. Comme il s'agit d'une implémentation pure de slf4j, il n'a pas besoin d'une bibliothèque de liaisons et il se connecte au débogage si aucun fichier de configuration n'est fourni, ce qui correspond réellement à votre problème. Pour résoudre votre problème, excluez la déconnexion de vos dépendances et ajoutez slf4j-log4j12 pour configurer slf4j avec log4j.


Edit : mis à jour avec divers commentaires

33
Stephane Nicoll

Vous devez désactiver commons-logging de la dépendance dans pom.xml fichier de l'application Web.

Même après avoir supprimé commons-logging de pom.xml veuillez vérifier la hiérarchie des dépendances disponible dans Eclipse ou STS IDE. Cela vous aidera à savoir si elle est ajoutée d'une manière ou d'une autre en raison d'une autre dépendance que nous ne connaissons peut-être pas.

0
SachinSarawgi