|
|
@ -21,9 +21,12 @@ https://juejin.cn/post/6844903775631572999 |
|
|
|
<include resource="log/MesToErp.xml"/>--> |
|
|
|
|
|
|
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|
|
|
<encoder> |
|
|
|
<!-- 控制台彩色日志--> |
|
|
|
<withJansi>true</withJansi> |
|
|
|
<!-- <encoder>--> |
|
|
|
<encoder class="com.yomahub.tlog.core.enhance.logback.AspectLogbackEncoder"> |
|
|
|
<pattern>${log.pattern}</pattern> |
|
|
|
<charset>${log.charset}</charset> |
|
|
|
<!-- <charset>${log.charset}</charset>--> |
|
|
|
</encoder> |
|
|
|
</appender> |
|
|
|
|
|
|
@ -41,15 +44,20 @@ https://juejin.cn/post/6844903775631572999 |
|
|
|
<!--所有日志最多占多大容量--> |
|
|
|
<totalSizeCap>20GB</totalSizeCap> |
|
|
|
</rollingPolicy> |
|
|
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
|
|
|
<!-- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">--> |
|
|
|
<!--这里替换成AspectLogbackEncoder--> |
|
|
|
<encoder class="com.yomahub.tlog.core.enhance.logback.AspectLogbackEncoder"> |
|
|
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
|
|
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|
|
|
<charset>${log.charset}</charset> |
|
|
|
</encoder> |
|
|
|
|
|
|
|
</appender> |
|
|
|
|
|
|
|
<!--异步到文件--> |
|
|
|
<appender name="asyncFileAppender" class="ch.qos.logback.classic.AsyncAppender"> |
|
|
|
<!-- 这里替换成AspectLogbackAsyncAppender --> |
|
|
|
<appender name="asyncFileAppender" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender"> |
|
|
|
<!-- <appender name="asyncFileAppender" class="ch.qos.logback.classic.AsyncAppender">--> |
|
|
|
<discardingThreshold>0</discardingThreshold> |
|
|
|
<queueSize>500</queueSize> |
|
|
|
<appender-ref ref="FILE"/> |
|
|
@ -120,10 +128,11 @@ https://juejin.cn/post/6844903775631572999 |
|
|
|
<springProfile name="dev"> |
|
|
|
<root level="info"> |
|
|
|
<appender-ref ref="CONSOLE"/> |
|
|
|
<appender-ref ref="esLogAppender" /> |
|
|
|
<appender-ref ref="esLogAppender"/> |
|
|
|
<appender-ref ref="asyncFileAppender"/> |
|
|
|
</root> |
|
|
|
<logger name="es-logger" level="warn" additivity="false"> |
|
|
|
<appender-ref ref="esLogAppender" /> |
|
|
|
<appender-ref ref="esLogAppender"/> |
|
|
|
</logger> |
|
|
|
<!--<logger name="org.springframework" level="ERROR" additivity="false"> |
|
|
|
<appender-ref ref="CONSOLE"/> |
|
|
|