简体   繁体   中英

Logback splunk error blocking of application run in spring boot

I have splunk TCP appender in logback to log messages in Splunk but local environment everybody may not have splunk forwarder in their machine. Is there to skip this one other than profile.

<appender name="tcpRootAppender"
        class="com.dtdsoftware.splunk.logging.logback.appender.SplunkRawTCPAppender">
        <port>1500</port>
        <host>localhost</host>
        <maxQueueSize>5000KB</maxQueueSize>
        <dropEventsOnQueueFull>true</dropEventsOnQueueFull>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%d %-5p  [%t] %c: %m%n%ex</pattern>
        </layout>
    </appender>

java.lang.IllegalStateException: Logback configuration error detected: ERROR in com.dtdsoftware.splunk.logging.logback.appender.SplunkRawTCPAppender[tcpRootAppender] - Couldn't establish Raw TCP connection for SplunkRawTCPAppender named "tcpRootAppender".

This is blocking application to help?. Can anyone help on this?. Thanks.

The easiest way is to set a different "logback" configuration file for each environment.

So for the local (dev?) environment, just remove that appender.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM