我设置了一个 logging.xml 文件,如下所示。该文件包括控制台的输出以及每天获取新文件的滚动文件:
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${application.home}/logs/application.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${application.home}/logs/application.%d{yyyy-MM-dd}.log</FileNamePattern>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
<appender name="A1" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%p %d{ISO8601} %c - %m%n</pattern>
</encoder>
</appender>
<logger name="javax.faces" level="debug" />
<root level="info">
<appender-ref ref="A1" />
<appender-ref ref="FILE" />
</root>
</configuration>
我的问题是如何输出类名?我尝试阅读 Play 文档,但找不到答案……在生产环境中也很难看到类名。谢谢您的帮助!