|
|
|
@ -71,11 +71,42 @@
|
|
|
|
|
</filter>
|
|
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
|
<appender name="GELF" class="de.siegmar.logbackgelf.GelfUdpAppender">
|
|
|
|
|
<!-- Graylog服务的地址 -->
|
|
|
|
|
<graylogHost>120.48.13.113</graylogHost>
|
|
|
|
|
<!-- UDP Input端口 -->
|
|
|
|
|
<graylogPort>12201</graylogPort>
|
|
|
|
|
<!-- 最大GELF数据块大小(单位:字节),508为建议最小值,最大值为65467 -->
|
|
|
|
|
<maxChunkSize>508</maxChunkSize>
|
|
|
|
|
<!-- 是否使用压缩 -->
|
|
|
|
|
<useCompression>true</useCompression>
|
|
|
|
|
<encoder class="de.siegmar.logbackgelf.GelfEncoder">
|
|
|
|
|
<!-- 是否发送原生的日志信息 -->
|
|
|
|
|
<includeRawMessage>false</includeRawMessage>
|
|
|
|
|
<includeMarker>true</includeMarker>
|
|
|
|
|
<includeMdcData>true</includeMdcData>
|
|
|
|
|
<includeCallerData>false</includeCallerData>
|
|
|
|
|
<includeRootCauseData>false</includeRootCauseData>
|
|
|
|
|
<!-- 是否发送日志级别的名称,否则默认以数字代表日志级别 -->
|
|
|
|
|
<includeLevelName>true</includeLevelName>
|
|
|
|
|
<shortPatternLayout class="ch.qos.logback.classic.PatternLayout">
|
|
|
|
|
<pattern>%m%nopex</pattern>
|
|
|
|
|
</shortPatternLayout>
|
|
|
|
|
<fullPatternLayout class="ch.qos.logback.classic.PatternLayout">
|
|
|
|
|
<pattern>%d - [%thread] %-5level %logger{35} - %msg%n</pattern>
|
|
|
|
|
</fullPatternLayout>
|
|
|
|
|
|
|
|
|
|
<!-- 配置应用名称(服务名称),通过staticField标签可以自定义一些固定的日志字段 -->
|
|
|
|
|
<staticField>app_name:austin</staticField>
|
|
|
|
|
</encoder>
|
|
|
|
|
</appender>
|
|
|
|
|
|
|
|
|
|
<root level="info">
|
|
|
|
|
<!-- TODO console打印后面可以只针对dev环境的 -->
|
|
|
|
|
<appender-ref ref="CONSOLE"/>
|
|
|
|
|
<appender-ref ref="INFO_FILE"/>
|
|
|
|
|
<appender-ref ref="ERROR_FILE"/>
|
|
|
|
|
<appender-ref ref="GELF"/>
|
|
|
|
|
</root>
|
|
|
|
|
|
|
|
|
|
</configuration>
|