log4j 禁止类输出日志,如何通过我的log4j配置禁用jose4j日志消息?

I am using jose4j in a java application that I am working on. It is a json web token library, and I've found that putting the package name inside my log4j config file does nothing to quiet the (many) debug logging messages that I am seeing from this thing. Here's my relevant log4j config section

So, I essentially only want to see log messages from jose4j when they rise to the level of warn (or more dire).

A few things I have been able to gather.

Setting the root logger to "info" does make the jose4j debug messages go away, so jose4j's logger at least knows about my logging setup.

It looks like the logger that jose4j uses is org.sl4j

I had a similar issue yesterday. It seemed like adding a few jars did the trick to fix that issue, but I'm not having luck with this.

I also added this jar to the classpath... this also did not work.

Does anyone know how I can get this library to work with my logging setup?

解决方案

Two points:

You need to have only one implementation of the slf4j interface. Just open the org.slf4j.spi.LoggerFactoryBinder and check the Type hierarchy (Ctrl-T in Eclipse).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值