log4j1 如何平滑升级到log4j2呢

如题,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/

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 Runtime Dependencies.

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, 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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值