Log4j ';英菲尼斯潘核心';不显示日志

Log4j ';英菲尼斯潘核心';不显示日志,log4j,infinispan,infinispan-8,Log4j,Infinispan,Infinispan 8,我正在使用log4j(1.2.17) “infinispan-embedded”可用于我的日志 但当我改用“infinispan-core”时,我没有收到来自infinispan的任何日志 我有春天(4.1.4)和冬眠(4.2.21) Infinispan版本-8.2.6.4最终版 有什么想法吗 谢谢 我的依赖:树是: [INFO] ------------------------------------------------------------------------ [INFO]

我正在使用log4j(1.2.17)

“infinispan-embedded”可用于我的日志

但当我改用“infinispan-core”时,我没有收到来自infinispan的任何日志

  • 我有春天(4.1.4)和冬眠(4.2.21)
  • Infinispan版本-8.2.6.4最终版
有什么想法吗

谢谢

我的依赖:树是:

[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

我以前也经历过类似的情况。这里的问题很可能是使用infinispan core时缺少依赖项

解决此类问题的方法是通过逐步调试代码来理解为什么找不到记录器。您可以通过在方法的开始处放置断点来实现这一点。该方法检测将使用哪个记录器,无论是JDK、Log4j、Log4j2、Slf4j……等等


因此,放回嵌入的依赖项,在该方法中放一个断点,并验证是否添加了log4j1.x。然后,在infinispan core就绪的情况下尝试运行相同的程序,看看选择了什么提供程序(我猜它不是Log4j 1.x)。然后看看添加log4j1.x作为显式依赖项是否有效……等等:)

我以前也遇到过类似的情况。这里的问题很可能是使用infinispan core时缺少依赖项

解决此类问题的方法是通过逐步调试代码来理解为什么找不到记录器。您可以通过在方法的开始处放置断点来实现这一点。该方法检测将使用哪个记录器,无论是JDK、Log4j、Log4j2、Slf4j……等等


因此,放回嵌入的依赖项,在该方法中放一个断点,并验证是否添加了log4j1.x。然后,在infinispan core就绪的情况下尝试运行相同的程序,看看选择了什么提供程序(我猜它不是Log4j 1.x)。然后看看添加log4j1.x作为显式依赖项是否有效……等等:)

Thanku Galder!-你带我看完了答案

我看到在我使用的版本中,jboss日志记录上有一个小错误:
3.2.0.Final
,并将其升级到:
3.3.1.Final
修复了它

该错误仅适用于方法中的log4j1.x

LoggerProviders.tryLog4j

谢谢高尔德你带我看完了答案

我看到在我使用的版本中,jboss日志记录上有一个小错误:
3.2.0.Final
,并将其升级到:
3.3.1.Final
修复了它

该错误仅适用于方法中的log4j1.x

LoggerProviders.tryLog4j

你的提示让我尝试了以下方法:-Dorg.jboss.logging.provider=slf4j,现在我的日志工作了!。。。经过一些调查,我发现
infinispan-spring
拉入了log4j2,这就是jboss.logging试图使用它的原因。删除log4j2后,它会自动工作。JayAnother:请避免infinispan作为Maven/Gradle项目的依赖项嵌入。这些JAR就是我们所说的uber JAR,它们是为没有依赖解析功能的构建系统而设计的。您的提示让我尝试了以下方法:-Dorg.jboss.logging.provider=slf4j,现在我的日志工作了!。。。经过一些调查,我发现
infinispan-spring
拉入了log4j2,这就是jboss.logging试图使用它的原因。删除log4j2后,它会自动工作。JayAnother:请避免infinispan作为Maven/Gradle项目的依赖项嵌入。这些JAR就是我们所说的uber JAR,它们是为不具备依赖解析功能的构建系统而设计的。