我是 Spring Cloud Task 的新手。我正在尝试设置 Hello World 示例应用程序。它运行并且按照这里的示例一切似乎都很好。但是我看到下面的输出。我看到一些 slf4j 警告。但是我的理解是 spring boot 应该提供默认设置。为什么我看到不同的日志文件有什么原因?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
Hello World!
我的application.properties
已经有了这个。
logging.level.org.springframework.cloud.task=DEBUG
spring.application.name=demo
编辑 当我在我的 pom 中添加 spring 批处理启动器时,日志开始显示正常并且 slf4j 警告消失了。如果我们只有 spring 云任务,我猜想 slf4j 配置会丢失。是否有任何特定原因将其配置为特定于 Spring Cloud 任务?