alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
29.46k stars 12.66k forks source link

Log4j2 升级到 2.23.1版本后,Nacos 会导致 Log4j2 日志输出异常 #12102

Open ldcsaa opened 1 month ago

ldcsaa commented 1 month ago

Describe the bug Log4j2 升级到 2.23.1版本后,Nacos 会导致 Log4j2 日志输出异常:

2024-05-15T09:51:31.358800400Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-05-15T09:51:31.359776400Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-05-15T09:51:31.360752300Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-05-15T09:51:31.360752300Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-05-15T09:51:31.375392700Z main WARN No Root logger was configured, creating default ERROR-level Root logger with Console appender

是不是 Nacos 与 Log4j2 不够兼容导致的? PS:配置了系统属性nacos.logging.default.config.enabled=false后,则不报异常警告了。或者Log4j2 回退到 2.22.1版本后也正常。

Expected behavior nacos兼容log4j2-2.23.1.

Actually behavior nacos不能很好兼容log4j2-2.23.1.

How to Reproduce Steps to reproduce the behavior:

  1. 升级到log4j2-2.23.1
  2. 启动nacos应用程序

Desktop (please complete the following information):

276663354 commented 1 month ago

spring-boot版本:3.2.4 spring-cloud-alibaba版本:2023.0.1.0 nacos-client版本:2.3.2 log4j2版本:2.21.1(此log4j2版本是spring-boot 3.2.4内置依赖) log4j2使用自定义的配置文件名:log4j2-dev.xml 在这套组件中能复现和提问者相同的问题