log4j1 如何平滑升级到log4j2呢
2017-07-10 11:28
1486 查看
如题,log4j1 如何平滑升级到log4j2呢? 原来使用Logger.getLogger方法获取到org.apache.log4j.Logger对象的 ,现在LogManager.getLogger 方法获取到org.apache.logging.log4j.Logger
知道了
有一个专门的jar包 log4j-1.2-api-2.0.jar ,导入就可以了,原来代码没有影响。
官网适配器:http://logging.apache.org/log4j/2.x/log4j-1.2-api/
The Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use Log4j 2 instead.
The Log4j 1.2 bridge is dependent on the Log4j 2 API and implementation. For more information, see Runtime
Dependencies.
To use the Log4j Legacy Bridge just remove all the Log4j 1.x jars from the application and replace them with the bridge jar. Once in place all logging that uses Log4j 1.x will be routed to Log4j 2. However, applications
that attempt to modify legacy Log4j by adding Appenders, Filters, etc may experience problems if they try to verify the success of these actions as these methods are largely no-ops.
知道了
有一个专门的jar包 log4j-1.2-api-2.0.jar ,导入就可以了,原来代码没有影响。
官网适配器:http://logging.apache.org/log4j/2.x/log4j-1.2-api/
Log4j 1.2 Bridge
The Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use Log4j 2 instead.
Requirements
The Log4j 1.2 bridge is dependent on the Log4j 2 API and implementation. For more information, see RuntimeDependencies.
Usage
To use the Log4j Legacy Bridge just remove all the Log4j 1.x jars from the application and replace them with the bridge jar. Once in place all logging that uses Log4j 1.x will be routed to Log4j 2. However, applicationsthat attempt to modify legacy Log4j by adding Appenders, Filters, etc may experience problems if they try to verify the success of these actions as these methods are largely no-ops.
相关文章推荐
- log4j使用SocketAppender推送日志到远程服务器(包含log4j如何升级到log4j2,并使用SocketAppender发送日志到LogStash)
- 项目升级log4j2,明明配置了log4j2.xml,可就是报错找不到
- log4j平滑升级为log4j2(不需改动源码)
- Log4j2.x的使用(Log4j1.x升级到Log4j2.x)
- 如何安全的将SQL Server Express数据库平滑升级到完整版
- log4j平稳升级到log4j2
- log4j升级为log4j2(无需改动代码)
- log4j2 升级问题 (包含log4j与slf4j版本)
- Log4j1 升级 Log4j2 实战
- log4j-升级log4j2
- 如何引入log4j and log4j2
- 如何绘制平滑的反走样线
- 〖收藏〗如何升级hotmail邮箱容量
- 如何把Hibernate2.1升级到Hibernate3.0?
- Redhat升级至2.6.0!Vmware成功案例——说明如何配置VMware中的SCSI驱动
- 如何把Hibernate2.1升级到Hibernate3.0
- 如何设置系统与正确删除软件和升级系统
- 如何将EVC4工程升级到VS.NET2005工程
- 学习如何用自己的 appender 来扩展 log4j 框架
- 如何将Windows 2000域控制器升级到Windows Server 2003