首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >logback配置调试属性对logback-spring.xml文件有效吗?

logback配置调试属性对logback-spring.xml文件有效吗?
EN

Stack Overflow用户
提问于 2021-02-27 06:25:26
回答 1查看 15关注 0票数 0

我使用的是Spring Boot2.4.3,并且在我的logback-spring.xml中设置了<configuration debug="true">,但是没有状态消息打印到控制台。

我的logback-spring.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
  <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
  <springProfile name="default">
    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
    <root level="INFO">
      <appender-ref ref="CONSOLE"/>
    </root>
  </springProfile>
  <springProfile name="!default">
    <appender name="JSON_CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
      <encoder class="net.logstash.logback.encoder.LogstashEncoder">
        <includeTags>false</includeTags>
      </encoder>
    </appender>
    <root level="INFO">
      <appender-ref ref="JSON_CONSOLE"/>
    </root>
  </springProfile>
</configuration>

我从Logback documentation获得了配置。

此配置是否仅适用于logback.xml文件?

EN

回答 1

Stack Overflow用户

发布于 2021-02-27 06:33:24

配置工作正常,这是我的错,我仔细分析了日志,并打印了消息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66393535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档