<!-- 节制台输出 -->
<apper name="console" class="ch.qos.logback.core.ConsoleApper">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<!-- 日记输出编码 -->
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</apper>
<!-- 为logstash输出的json格局的Apper -->
<apper name="logstash" class="net.logstash.logback.apper.LogstashTcpSocketApper">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<destination>127.0.0.1:9601</destination>
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<!--<timestamp>-->
<!--<timeZone>UTC</timeZone>-->
<!--</timestamp>-->
<pattern>
<pattern>
{
"severity": "%level",
"service": "${springAppName:-}",
"trace": "%X{X-B3-TraceId:-}",
"span": "%X{X-B3-SpanId:-}",
"exportable": "%X{X-Span-Export:-}",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{40}",
"rest": "%message"
}
</pattern>
</pattern>
</providers>
</encoder>
</apper>
<root level="INFO">
<apper-ref ref="console"/>
<apper-ref ref="logstash"/>
</root>
</configuration>
推荐阅读
- 梧州东白茶-梧州东白茶采集技术
- 拼多多如何查看账号日志
- 蜂蜜的功效有哪些
- win10日志文件在哪个文件夹 怎么查看系统日志
- Matlab的GUI界面设计要准备哪些?CCD摄像采集
- 饥荒快速采集mod
- 钉钉如何查看日志故障
- 最好的蜂蜜是什么蜜
- 南北方普洱茶采集要点
- intellij idea如何设置控制台日志全部显示出来