spring cloud alibaba 2023.X 版本,启动报:Logback configuration error detected
1、报错信息如下:
Logging system failed to initialize using configuration from 'null'
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[CONFIG_LOG_FILE] - 'File' option has the same value "/Users/dunzung/logs/nacos/config.log" as that given for appender [CONFIG_LOG_FILE] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[CONFIG_LOG_FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[CONFIG_LOG_FILE] - For more information, please visit https://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[NAMING_LOG_FILE] - 'File' option has the same value "/Users/dunzung/logs/nacos/naming.log" as that given for appender [NAMING_LOG_FILE] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[NAMING_LOG_FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[NAMING_LOG_FILE] - For more information, please visit https://logback.qos.ch/codes.html#earlier_fa_collision
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[REMOTE_LOG_FILE] - 'File' option has the same value "/Users/dunzung/logs/nacos/remote.log" as that given for appender [REMOTE_LOG_FILE] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[REMOTE_LOG_FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[REMOTE_LOG_FILE] - For more information, please visit https://logback.qos.ch/codes.html#earlier_fa_collision
2、解决方式如下:
方式一,在启动类的 main 方法禁用 nacos 日志 log 组件。
@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class XXXApplication {
/**
* 程序的主入口。
*
* @param args 命令行参数
*/
public static void main(String[] args) {
System.setProperty("nacos.logging.default.config.enabled","false"); //加上这行代码即可
SpringApplication.run(StationApplication.class, args);
}
}
方式二,使用 jar 启动时,在启动参数中添加:-Dnacos.logging.default.config.enabled=false
4647

被折叠的 条评论
为什么被折叠?



