开发者

DBAppender - how to change default table names?

开发者 https://www.devze.com 2023-02-04 13:26 出处:网络
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

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消