6
Spring Boot Test忽略logging.level
我的maven模块之一在运行测试时会忽略我的日志记录级别。 在src/test/resources我有application.properties: app.name=bbsng-import-backend app.description=Import Backend Module for Application spring.profiles.active=test # LOGGING logging.level.root=error logging.level.org.springframework.core =fatal logging.level.org.springframework.beans=fatal logging.level.org.springframework.context=fatal logging.level.org.springframework.transaction=error logging.level.org.springframework.test=error logging.level.org.springframework.web=error logging.level.org.hibernate=ERROR 我也试过了application-test.properties。 我的应用程序记录很多,尤其是在加载上下文时。我想logback.xml,logback-test.xml和logback-spring.xml,但没有什么帮助。 我的pom: <parent> <groupId>at.company.bbsng</groupId> <artifactId>bbsng-import</artifactId> <version>0.1.0-SNAPSHOT</version> </parent> <artifactId>bbsng-import-backend</artifactId> <name>bbsng-import-backend</name> <properties> <start-class>at.company.bbsng.dataimport.ApplicationImportBackend</start-class> </properties> <dependencies> <!-- APPLICATION ... --> <dependency> <groupId>at.company.bbsng</groupId> <artifactId>bbsng-app-domain</artifactId> <scope>test</scope> </dependency> <!-- SPRING ... --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-batch</artifactId> …