Programmatically configure LogBack appender

前端 未结 5 687
死守一世寂寞
死守一世寂寞 2020-11-28 23:50

I have a logback appender defined in the logback.xml, it\'s a DB appender, but I\'m curious if there is any way to configure the appender in java using my own connection poo

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 00:41

    You can configure appenders programmatically. Almost all appenders are tested using programmatic configuration. It follows that there are many examples of programmatic appender configuration in the logback project source code. For a logback-core appender, look under logback-core/src/test/java, and for a logback-classic appender look under logback-classic/src/test/java.

提交回复
热议问题