我正在try 为一个Spring应用程序使用Logback进行TRACE日志(log)记录.然而,使用我拥有的配置,我最多只能获得DEBUG个输出到控制台的日志(log).

Any ideas if there is some configuration that will help me get TRACE as well?
I have read several tutorials and haven't found much. This is what I have so far for configuration:

使用Java 19

Logback.xml:

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
    </appender>
    
    <root level="trace">
        <appender-ref ref="STDOUT" />
    </root>
    
    <logger name="org.springframework.security" level="trace">
        <appender-ref ref="STDOUT" />
    </logger>

</configuration>

相关pom.xml:

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-core</artifactId>
    <version>1.5.0</version>
</dependency>

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.1.0-alpha1</version>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.5.0</version>
</dependency>

推荐答案

我正在用你的logback.xml档案记录 spring 保安trace.因此,我的看法是,要么Spring Security在您的场景中没有执行任何跟踪日志(log)记录,要么您的logback.xml没有生效.如果您的控制台上有用于Spring安全的debug日志(log)记录,则后者可能会被消除.

Java相关问答推荐

计算战舰沉船/船只的问题(Java)

Java 8 RDX-如何设置单个选项卡标题文本的 colored颜色

获取拦截器内部的IP地址

如何将kotlin代码转换为java

无法找到符号错误—Java—封装

缩小画布比例后更改滚动窗格的内部大小

Java inline Double条件和值解装箱崩溃

Jlink选项&-strie-ative-Commands";的作用是什么?

Java FX中的河内之塔游戏-在游戏完全解决之前什么都不会显示

RESTful框架类字段是安全的还是不安全的

是否在允许数组元素为空时阻止 idea 为空性警告?

AssertJ Java:多条件断言

使用Jolt将字段转换为列表

尽管通过中断请求线程死亡,但线程仍将继续存在

为什么没有加载java.se模块?

Java System.getProperty在哪里检索user.home?

为什么Instant没有从UTC转换为PostgreSQL的时区?

如何设置默认序列生成器分配大小

在JPanel上使用GridBagLayout并将JButton放在里面时出现问题

Java 8 中 ByteBuffer 和 BitSet 的奇怪行为