我使用的是spring-boot 1.3 logback-1.1.5 版本
首先是boot配置
# Mysql
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/test2?createDatabaseIfNotExist=true
spring.datasource.username = root
spring.datasource.password = root
# jpa
spring.jpa.database = MYSQL
spring.jpa.show-sql = true
spring.jpa.hibernate.ddl-auto = update
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
## log
logging.level.com.trs.trsirp = DEBUG
#logging.file = logs/logback.log
接下来是logback配置:
com.mysql.jdbc.Driver
jdbc:mysql://localhost:3306/test2
root
root
在接下来是报错:
Exception in thread "main" java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:66 - no applicable action for [dataSource], current ElementPath is [[configuration][appender][connectionSource][dataSource]]
如果把配置里面的
dataSource
去掉就可以运行,但是为什么加上就出现这样的错误 ?
第二个问题就是如果把
root 标签的level改成debug
启动就会卡在spring-boot 1.3 启动最开始有一个图案那就地方,不会往下执行 ,这是为什么 ?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
connectionSource配置错了,你配置的那个类不支持datasource配置。要支持的话,可以换成