Java 如何在不使用xml配置的情况下禁用Spring引导中的调试消息?

Java 如何在不使用xml配置的情况下禁用Spring引导中的调试消息?,java,spring,logging,Java,Spring,Logging,在使用Spring boot运行应用程序时,有没有办法禁用调试日志记录 以下是我创建上下文的方式: AnnotationConfigApplicationContext annotationContext = new AnnotationConfigApplicationContext(SpringConfig.class); 我只能找到XMLSpring配置文件的示例。 我使用的不是任何XML,而是一个配置类(SpringConfig.class),我在其中创建所有必需的@bean。在您的a

在使用Spring boot运行应用程序时,有没有办法禁用调试日志记录

以下是我创建上下文的方式:

AnnotationConfigApplicationContext annotationContext = new AnnotationConfigApplicationContext(SpringConfig.class);
我只能找到XMLSpring配置文件的示例。
我使用的不是任何XML,而是一个配置类(SpringConfig.class),我在其中创建所有必需的@bean。

在您的application.properties中设置为off log

logging.level.root=OFF

检查是否有办法在Spark中指定此选项?假设我只想禁用Spark日志记录。我不知道Spark的软件包是什么,但假设它是com.Spark,那么您需要设置为logging.level.com.Spark=OFF