DBAppender - how to change default table names?

Can I change the default table names for DBAppender in Logback and how can I do this?

PS DBAppender sources, I found that DBAppender uses the DBNameResolver interface to get table names. I can implement this interface in user dbNameResolver and then use user-defined table names, but the main problem for me is how to set this user-made dbNameResolver in my DBAppender ... is this possible?

+5
source share
1 answer

The API documentation shows that DBAppender has setDbNameResolver() which can be called programmatically or, if I understood how the configuration file works, just using something like:

 <appender name="DB" class="ch.qos.logback.classic.db.DBAppender"> <.../> <dbNameResolver class="fqdn.to.my.DBNameResolver"/> </appender> 
+4
source

Source: https://habr.com/ru/post/1335534/


All Articles