alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.93k stars 8.57k forks source link

使用log4j2的时候,出现了报警。log4j是没问题的 #1422

Open 89333367 opened 8 years ago

89333367 commented 8 years ago

温少,我在新项目使用了log4j2版本,后台就报警报了,以前用log4j是没问题的,用第2版就出现了这个,怎么解决? log4j:WARN No appenders could be found for logger (com.alibaba.druid.pool.DruidDataSource). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

renfufei commented 7 years ago

请参考: Druid内置提供了四种LogFilter(Log4jFilter、Log4j2Filter、CommonsLogFilter、Slf4jLogFilter)

imic07 commented 7 years ago

出现warn是这里的原因 image Log4jImpl 先于 Log4j2Impl 加载

Dreampie commented 3 years ago

spring.datasource.druid.log-type=log4j2 这样不行吗?