DBAppender - how to change default table names?
Is it possible to change the default table names for DBAppender
in Logback and how can I do it ?
P.S. Browsing the sources I found that DBAppender
uses the DBNameResolver
interface for getting table names,开发者_开发技巧 I can implement this interface in a custom-made dbNameResolver
and then use custom-made table names, but the major problem for me is how to set that custom-made dbNameResolver
into my DBAppender
... is that possible ?
From the API docs, it appears that DBAppender
has a setDbNameResolver()
property which could be invoked programatically, or, if I've understood how the configuration file works properly, just using something like:
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
<.../>
<dbNameResolver class="fqdn.to.my.DBNameResolver"/>
</appender>
精彩评论