简体   繁体   English

使用log4j迁移到具有参考库的log4j2

[英]Migrating to log4j2 with referenced libraries using log4j

We have a web services application running on Jboss Openshift using Apache Axis2. 我们有一个使用Apache Axis2在Jboss Openshift上运行的Web服务应用程序。 We are migrating to log4j2. 我们正在迁移到log4j2。 However apart from our application logs some logs of the reference libraries such as axis2 logs, hazelcast logs are getting logged using log4j. 但是,除了我们的应用程序日志之外,参考库的某些日志(例如axis2日志),hazelcast日志也正在使用log4j进行日志记录。 We came to this conclusion as they are still using the old log4.properties file instead of the log4j2.xml file. 我们得出了这个结论,因为他们仍在使用旧的log4.properties文件而不是log4j2.xml文件。 Our application is using the log4j2.xml file. 我们的应用程序正在使用log4j2.xml文件。 Hence 2 log files are getting created, one for log4j and one for log4j2. 因此,将创建2个日志文件,其中一个用于log4j,一个用于log4j2。 We tried adding the adapter jars provided in the migration guide and also removed all references to log4j jars but to no avail. 我们尝试添加迁移指南中提供的适配器jar,还删除了所有对log4j jar的引用,但无济于事。 Please help. 请帮忙。 Thanks. 谢谢。

If the logs are still being logged using the log4j.properties then there is still a copy of log4j on the classpath. 如果仍使用log4j.properties记录日志,则在类路径上仍存在log4j的副本。 If you remove log4j.properties you should see log4j emit a warning about not being configured. 如果删除log4j.properties,则应该看到log4j发出有关未配置的警告。 So long as that appears log4j is still present. 只要出现,log4j仍然存在。

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

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