简体   繁体   English

'infinispan-core'不显示日志

[英]'infinispan-core' not showing logs

I'm using log4j (1.2.17) 我正在使用log4j(1.2.17)

'infinispan- embedded ' does work with my logs. “ infinispan- embedded ”确实适用于我的日志。

But when I change to work with: 'infinispan- core ' I don't recive any logs from Infinispan. 但是当我更改为使用“ infinispan- core ”时,我不会从Infinispan接收任何日志。

  • I have Spring(4.1.4) & Hibernate(4.2.21) 我有Spring(4.1.4)和Hibernate(4.2.21)
  • Infinispan version - 8.2.6.Final Infinispan版本-8.2.6.Final

Any ideas? 有任何想法吗?

Thanks. 谢谢。

my dependecy:tree is: 我的dependecy:树是:

[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

I've been through similar situations before. 我以前也经历过类似的情况。 The problem here is most likely that there's a dependency missing when using infinispan-core. 这里的问题很可能是使用infinispan-core时缺少依赖项。

The way to address such issues is by step-debugging through the code to understand why the logger is not being found. 解决此类问题的方法是逐步调试代码以了解为什么找不到记录器。 You can do that by putting a breakpoint at the start of org.jboss.logging.LoggerProviders.findProvider() method. 您可以通过在org.jboss.logging.LoggerProviders.findProvider()方法的开头放置一个断点来实现。 That method detects which logger will be used, whether JDK, Log4j, Log4j2, Slf4j...etc. 该方法检测将使用哪个记录器,是否是JDK,Log4j,Log4j2,Slf4j ...等。

So, put back the embedded dependency, put a breakpoint in that method, and verify that Log4j 1.x is added. 因此,放回嵌入式依赖关系,在该方法中放置一个断点,并验证是否已添加Log4j1.x。 Then, try running the same with infinispan-core in place and see what provider gets chosen (I guess it's not Log4j 1.x). 然后,尝试在适当的infinispan-core上运行相同的命令,并查看选择了哪个提供程序(我想这不是Log4j 1.x)。 Then see if adding Log4j 1.x as explicit dependency works...etc :) 然后看看是否将Log4j 1.x添加为显式依赖项有效...等:)

Thanku Galder! Thanku Galder! - You walk me throught the solution. -您带领我解决问题。

I saw that there were a tiny bug on the jboss-logging in the version I used: 我发现在我使用的版本的jboss-logging中有一个小错误:
3.2.0.Final 3.2.0.Final
and upgrading it to: 并将其升级到:
3.3.1.Final 3.3.1.Final
fixed it. 修复。

The bug was only for log4j 1.x in the method: 该错误仅适用于log4j 1.x方法:

LoggerProviders.tryLog4j

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM