我使用 log4j(1.2.17)
' infinispan-的嵌入'可以使用我的日志。
但是当我改变工作时:' infinispan- 核心'我不会从Infinispan收到任何日志。
有什么想法吗?
感谢。
我的依赖:树是:
[INFO] ------------------------------------------------------------------------
[INFO] Building myapp War 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ myapp-war ---
[INFO] com.mycompany.myapp.myapp-app:myapp-war:war:1.0-SNAPSHOT
[INFO] +- com.mycompany.myapp.myapp-app:myapp-core:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.mycompany.myapp.common-framework:common-framework-core:jar:1.0-SNAPSHOT:compile
[INFO] | | +- com.mycompany.myapp.common-framework:common-framework-api:jar:1.0-SNAPSHOT:compile
[INFO] | | | +- org.springframework:spring-context-support:jar:4.1.4.RELEASE:compile
[INFO] | | | +- net.sf.jasperreports:jasperreports:jar:6.3.0:compile
[INFO] | | | | +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | | | | +- com.lowagie:itext:jar:2.1.7.js5:compile
[INFO] | | | | +- org.jfree:jcommon:jar:1.0.23:compile
[INFO] | | | | +- org.eclipse.jdt.core.compiler:ecj:jar:4.3.1:compile
[INFO] | | | | \- org.codehaus.castor:castor-xml:jar:1.3.3:compile
[INFO] | | | | +- org.codehaus.castor:castor-core:jar:1.3.3:compile
[INFO] | | | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | | | +- stax:stax:jar:1.2.0:compile
[INFO] | | | | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | | | | \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | +- org.apache.commons:commons-csv:jar:1.1:compile
[INFO] | | | +- org.quartz-scheduler:quartz:jar:2.2.2:compile
[INFO] | | | +- org.quartz-scheduler:quartz-jobs:jar:2.2.2:compile
[INFO] | | | \- commons-net:commons-net:jar:3.3:compile
[INFO] | | +- org.apache.commons:commons-email:jar:1.4:compile
[INFO] | | | \- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] | | +- javax.activation:activation:jar:1.1.1:compile
[INFO] | | +- jasperreports-fonts:jasperreports-fonts:jar:1.1:compile
[INFO] | | +- net.sf.jasperreports:jasperreports-html-component:jar:6.1.0b:compile
[INFO] | | \- net.sourceforge.jexcelapi:jxl:jar:2.6.12:compile
[INFO] | +- com.mycompany.myapp.myapp-app:myapp-api:jar:1.0-SNAPSHOT:compile
[INFO] | | +- com.mycompany.myapp.common-framework:common-framework-persistence:jar:1.0-SNAPSHOT:compile
[INFO] | | \- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | | \- commons-codec:commons-codec:jar:1.9:compile
[INFO] | \- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] +- com.mycompany.myapp.myapp-app:myapp-webapp:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.mycompany.myapp.common-framework:common-framework-webapp:jar:1.0-SNAPSHOT:compile
[INFO] | | +- org.apache.wicket:wicket-extensions:jar:6.21.0:compile
[INFO] | | +- org.apache.wicket:wicket-datetime:jar:6.21.0:compile
[INFO] | | +- org.apache.wicket:wicket-auth-roles:jar:6.21.0:compile
[INFO] | | +- org.odlabs.wiquery:wiquery-core:jar:6.13.0:compile
[INFO] | | +- org.odlabs.wiquery:wiquery-jquery-ui:jar:6.13.0:compile
[INFO] | | +- net.sourceforge.pjl-comp-filter:pjl-comp-filter:jar:1.8.1:compile
[INFO] | | +- com.octo.captcha:jcaptcha:jar:2.0-alpha-1:compile
[INFO] | | | +- com.octo.captcha:jcaptcha-api:jar:2.0-alpha-1:compile
[INFO] | | | \- com.jhlabs:filters:jar:2.0.235:compile
[INFO] | | \- net.redhogs.cronparser:cron-parser-core:jar:2.9:compile
[INFO] | +- org.apache.wicket:wicket-core:jar:6.21.0:compile
[INFO] | | +- org.apache.wicket:wicket-util:jar:6.21.0:compile
[INFO] | | \- org.apache.wicket:wicket-request:jar:6.21.0:compile
[INFO] | +- com.pingunaut:wicket-chartjs:jar:6.21.0:compile
[INFO] | +- org.apache.wicket:wicket-spring:jar:6.21.0:compile
[INFO] | | \- org.apache.wicket:wicket-ioc:jar:6.21.0:compile
[INFO] | | +- cglib:cglib:jar:2.2.2:compile
[INFO] | | | \- asm:asm:jar:3.3.1:compile
[INFO] | | \- javax.inject:javax.inject:jar:1:compile
[INFO] | +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] | \- org.wicketstuff:wicketstuff-restannotations-json:jar:6.21.0:compile
[INFO] | +- org.wicketstuff:wicketstuff-restannotations:jar:6.21.0:compile
[INFO] | \- org.apache.wicket:wicket:pom:6.21.0:compile
[INFO] +- com.mycompany.myapp.myapp-app:myapp-ws:jar:1.0-SNAPSHOT:compile
[INFO] +- org.eclipse.jetty.aggregate:jetty-all-server:jar:8.1.14.v20131031:provided
[INFO] | +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:provided
[INFO] | +- org.eclipse.jetty.orbit:javax.security.auth.message:jar:1.0.0.v201108011116:provided
[INFO] | +- org.eclipse.jetty.orbit:javax.mail.glassfish:jar:1.4.1.v201005082020:provided
[INFO] | +- org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233:provided
[INFO] | \- org.eclipse.jetty.orbit:javax.annotation:jar:1.1.0.v201108011116:provided
[INFO] +- com.oracle:ojdbc6:jar:6.0:compile
[INFO] +- org.springframework.ws:spring-ws-core:jar:2.2.0.RELEASE:compile
[INFO] | +- org.springframework.ws:spring-xml:jar:2.2.0.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.2.21.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.2.Final:compile
[INFO] | \- org.hibernate:hibernate-core:jar:4.2.21.Final:compile
[INFO] | \- antlr:antlr:jar:2.7.7:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-ehcache:jar:4.2.21.Final:compile
[INFO] | \- net.sf.ehcache:ehcache-core:jar:2.4.3:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.7:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] +- org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:jar:1.16:compile
[INFO] +- org.lazyluke:log4jdbc-remix:jar:0.2.7:compile
[INFO] | \- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.infinispan:infinispan-core:jar:8.2.6.Final:compile
[INFO] | +- org.infinispan:infinispan-commons:jar:8.2.6.Final:compile
[INFO] | +- org.jgroups:jgroups:jar:3.6.7.Final:compile
[INFO] | \- org.jboss.marshalling:jboss-marshalling-osgi:jar:2.0.0.Beta3:compile
[INFO] +- org.jboss.logging:jboss-logging:jar:3.2.0.Final:compile
[INFO] +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] +- com.google.guava:guava:jar:19.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.7:compile
[INFO] +- joda-time:joda-time:jar:2.7:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.0:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.4.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.3:compile
[INFO] +- org.reflections:reflections:jar:0.9.10:compile
[INFO] | +- org.javassist:javassist:jar:3.19.0-GA:compile
[INFO] | \- com.google.code.findbugs:annotations:jar:2.0.1:compile
[INFO] +- xml-apis:xml-apis:jar:1.0.b2:provided
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] \- javax.servlet:javax.servlet-api:jar:3.1.0:compile
答案 0 :(得分:3)
我以前经历过类似的情况。这里的问题很可能是在使用infinispan-core时缺少依赖性。
解决此类问题的方法是逐步调试代码,以了解找不到记录器的原因。你可以通过在org.jboss.logging.LoggerProviders.findProvider()方法的开头加一个断点来做到这一点。该方法检测将使用哪个记录器,JDK,Log4j,Log4j2,Slf4j ......等。
因此,放回嵌入式依赖项,在该方法中放置一个断点,并验证是否添加了Log4j 1.x.然后,尝试使用infinispan-core运行相同的内容并查看选择的提供程序(我猜它不是Log4j 1.x)。然后看看是否将Log4j 1.x添加为显式依赖项...等等:)
答案 1 :(得分:1)
感谢高尔德! - 你带我走过了解决方案。
我看到我使用的版本中的 jboss-logging 上有一个小错误:
3.2.0.Final
和将其升级为: 3.3.1.Final
修复它。
该错误仅适用于方法中的log4j 1.x :
LoggerProviders.tryLog4j