logback报错:ERROR in

时间:2024-11-12 17:24:05

报错信息如下

Logging system failed to initialize using configuration from 'null'
: Logback configuration error detected: 
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in @121:18 - RuntimeException in Action for tag [springProfile] : logback stack error: 
	at (:179)
	at (:80)
	at (:60)
	at (:132)
	at (:312)
	at (:281)
	at (:239)
	at (:216)
	at (:176)
	at (:169)
	at (:143)
	at (:131)
	at (:82)
	at $environmentPrepared$2(:63)
	at (:1259)
	at (:117)
	at (:111)
	at (:62)
	at (:375)
	at (:333)
	at (:1340)
	at (:1329)
	at (:12)
2021-04-19 12:45:43.716 [main] [] [ERROR]  L871 - Application run failed
: : Logback configuration error detected: 
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in @121:18 - RuntimeException in Action for tag [springProfile] : logback stack error: 
	at (:327)
	at (:281)
	at (:239)
	at (:216)
	at (:176)
	at (:169)
	at (:143)
	at (:131)
	at (:82)
	at $environmentPrepared$2(:63)
	at (:1259)
	at (:117)
	at (:111)
	at (:62)
	at (:375)
	at (:333)
	at (:1340)
	at (:1329)
	at (:12)
Caused by: : Logback configuration error detected: 
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in @121:18 - RuntimeException in Action for tag [springProfile] : logback stack error: 
	at (:179)
	at (:80)
	at (:60)
	at (:132)
	at (:312)
	... 18 common frames omitted
Exception in thread "main" : : Logback configuration error detected: 
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in @121:18 - RuntimeException in Action for tag [springProfile] : logback stack error: 
	at (:327)
	at (:281)
	at (:239)
	at (:216)
	at (:176)
	at (:169)
	at (:143)
	at (:131)
	at (:82)
	at $environmentPrepared$2(:63)
	at (:1259)
	at (:117)
	at (:111)
	at (:62)
	at (:375)
	at (:333)
	at (:1340)
	at (:1329)
	at (:12)
Caused by: : Logback configuration error detected: 
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in  - Could not find Janino library on the class path. Skipping conditional processing.
ERROR in  - See also /#ifJanino
ERROR in @121:18 - RuntimeException in Action for tag [springProfile] : logback stack error: 
	at (:179)
	at (:80)
	at (:60)
	at (:132)
	at (:312)
	... 18 more

解决办法

引入mvn依赖即可

        <dependency>
            <groupId></groupId>
            <artifactId>janino</artifactId>
            <version>3.0.7</version>
        </dependency>

原因

正如报错信息中所说,当我们在的日志配置文件中使用了<if> ...</if>条件判断标签,logback需要依赖janino库来解析这些判断语句,而logback本身并没有依赖这个库,所以需要我们手动引入一下依赖。