title: Set sqldialect to logback db appender programmatically
body: <p>I'm writing source code for creating DBAppender to use the datasource of my connection pool. Now when I start the DBAppender I get the error "DBAppender cannot function if the JDBC driver does not support getGeneratedKeys method <em>and</em> without a specific SQL dialect". So I want to add the sqlDialect to my implementation but cannot find a way to do this.</p>
  
  <p>The code for adding the appender to the logger looks like:</p>
  
  <pre><code>LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
  
  DataSourceConnectionSource source = new DataSourceConnectionSource();
  
  source.setDataSource(Database.getInstance().getDatasource());
  
  DBAppender dbAppender = new DBAppender();
  dbAppender.setName("db");
  dbAppender.setConnectionSource(source);
  dbAppender.setContext(lc);      
  dbAppender.start();
  
  Logger logger = (Logger) LoggerFactory.getLogger(Loggerutils.class);
  logger.addAppender(dbAppender);
  logger.setLevel(Level.DEBUG);
  </code></pre>
  
  <p>When I check another project that using Logback I used <code>&lt;sqlDialect class="ch.qos.logback.core.db.dialect.MsSQLDialect" /&gt;</code> in my xml configuration.</p>
  
  <p>Is there a way to add the sqlDialect in my implementation of the appender?</p>