简体   繁体   English

apache-log4j-extras jar 可以与 apache log4j 2.x 一起使用吗

[英]can apache-log4j-extras jar be used with apache log4j 2.x

Can apache-log4j-extras jar be used with apache log4j 2.x jars, or is it deprecated? apache-log4j-extras jar 可以与 apache log4j 2.x jars 一起使用,还是已弃用?

found the jar to be last updated in 1.2.17 version.发现 jar 最后更新于 1.2.17 版本。

Since Apache Log4j 1.2 reached end-of-life almost 8 years ago, Apache Log4j Extras and libraries with Log4j 1.2 components should be considered deprecated.由于Apache Log4j 1.2在将近 8 年前达到了生命周期结束,因此 Apache Log4j Extras和带有 Log4j 1.2 组件的库应被视为已弃用。

All features provided by Apache Log4j Extras should be available in thereference implementation of the Log4j2 API and other implementations (such as Logback ). Apache Log4j 提供的所有功能 Extras应该在 Log4j2 API 和其他实现(例如Logback )的参考实现中可用。

PS : For completeness' sake, the Log4j 1.2 to Log4j2 API bridge does support native Log4j 1.2 components (works only if the underlying implementation is Log4j2 Core) and as a proof-of-concept I have successfully run the RollingFileAppender from Apache Extras. PS :为了完整起见, Log4j 1.2 到 Log4j2 API确实支持本机 Log4j 1.2 组件(仅当底层实现是 Log4j2 Core 时才有效)并且作为概念验证,我已经从 Apache Extras 成功运行了RollingFileAppender This usage is however not advised since native Log4j2 Core components perform much better.但是,建议使用这种用法,因为本机 Log4j2 Core 组件的性能要好得多。

If you just use the Log4j 1.2 configuration format, since 2.18.0 (cf. LOG4J2-3483 ), we added a configuration builder that recognizes the RollingFileAppender from Apache Extras and builds a Log4j2 native RollingFileAppender with the same configuration properties.如果您只是使用 Log4j 1.2 配置格式,从 2.18.0(参见LOG4J2-3483 )开始,我们添加了一个配置构建器,它可以识别来自 Apache Extras 的RollingFileAppender ,并构建一个具有相同配置属性的Log4j2 本机RollingFileAppender

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

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