Logback Do not inherit root appenders

后端 未结 1 359
说谎
说谎 2021-01-21 02:44

I have a logback config where I have one logger that should not inherit the syslog appender that has been added to the root logger. I can\'t find anywhere in the documentation h

相关标签:
1条回答
  • 2021-01-21 03:18

    Turn off additivity (default true) for your logger:

    <logger name="jsonlogger" level="INFO" additivity="false">
        <appender-ref ref="SYSLOGJSON" />
    </logger>
    

    As the logback-manual describes: http://logback.qos.ch/manual/configuration.html#overrridingCumulativity

    If you just want it to not have the SYSLOG appender, but FILE and STDOUT, you'll have to register those at the logger itself as well.

    0 讨论(0)
提交回复
热议问题