logfellow / logstash-logback-encoder

Logback JSON encoder and appenders
Apache License 2.0
2.44k stars 407 forks source link

Nacos added appender error #1022

Closed ncc0706 closed 2 months ago

ncc0706 commented 4 months ago

detail see https://github.com/alibaba/nacos/issues/11781

philsttr commented 3 months ago

I need more information. Preferably with reproducible code and config.

ncc0706 commented 3 months ago

@philsttr https://github.com/ncc0706/spring-boot-logstash.git

image

philsttr commented 3 months ago

The error messages that you have highlighted do not look related to logstash-logback-encoder. The error messages look related to the appenders defined in naco-logback.xml.

I can reproduce the same error messages without using logstash-logback-encoder by replacing this:

        <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
            <destination>${logstashHost}</destination>
            <encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder"/>
        </appender>

with this

        <appender name="LOGSTASH" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
                <pattern>%m</pattern>
            </encoder>
        </appender>

Since I can reproduce the error messages you see without using logstash-logback-encoder, I do not believe the error messages are caused by logstash-logback-encoder.

philsttr commented 3 months ago

You can set debug="true" in your logback-spring.xml to help debug.

<configuration scan="false" debug="true">
ncc0706 commented 2 months ago

Thanks, this is a bug in Nacos.

-Dnacos.logging.default.config.enabled=false