Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
logback-spring.xml
<!DOCTYPE configuration>
<configuration>
<contextName>test</contextName>
<jmxConfigurator/>
<appender name="gelf" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
<host>udp:localhost</host>
<port>12201</port>
<version>1.1</version>
<facility>java-test</facility>
<extractStackTrace>true</extractStackTrace>
<filterStackTrace>true</filterStackTrace>
<mdcProfiling>true</mdcProfiling>
<timestampPattern>yyyy-MM-dd HH:mm:ss,SSS</timestampPattern>
<maximumMessageSize>8192</maximumMessageSize>
<!-- This are static fields -->
<additionalFields>fieldName1=fieldValue1,fieldName2=fieldValue2</additionalFields>
<!-- Optional: Specify field types -->
<additionalFieldTypes>fieldName1=String,fieldName2=Double,fieldName3=Long</additionalFieldTypes>
<!-- This are fields using MDC -->
<mdcFields>mdcField1,mdcField2</mdcFields>
<dynamicMdcFields>mdc.*,(mdc|MDC)fields</dynamicMdcFields>
<includeFullMdc>true</includeFullMdc>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>
<root level="DEBUG">
<appender-ref ref="gelf" />
</root>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment