Graylog Spring Boot with Logback


(anas) #1

I create spring boot application i used logback implementation

i want send the output logs to "graylog" so what i using the "logstash-gelf" as dependency , then i changes the logback.xml as below :

test
<appender name="gelf" class="biz.paluch.logging.gelf.logback.GelfLogbackAppender">
    <host>172.16.60.226</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,SSSS</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>

i create UDP as input in graylog , when run the spring application the logs doesn't send to graylog


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.