[logback-user] DBAppender with JNDI, JTDS

Stein, Eric steine at locustec.com
Wed Mar 21 18:35:46 CET 2012


I'm playing around with DBAppender, trying to get it to work with my
webapp. What I'm finding is that this will log to the database:

 

    <connectionSource
class="ch.qos.logback.core.db.DriverManagerConnectionSource">

      <driverClass>net.sourceforge.jtds.jdbc.Driver</driverClass>

      <url>MY_URL</url>

      <user>MY_USERNAME</user>

      <password>MY_PASSWORD</password>

    </connectionSource>

 

but this won't:

 

    <connectionSource
class="ch.qos.logback.core.db.JNDIConnectionSource">

      <param name="jndiLocation" value="jdbc/MyDatabase" />

    </connectionSource>

 

Username and password are set in the datasource definition. The specific
error I'm getting is:

 

13:15:52,470 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter at 28:14
- RuntimeException in Action for tag [appender]
java.lang.IllegalStateException: DBAppender cannot function if the JDBC
driver does not support getGeneratedKeys method *and* without a specific
SQL dialect

     at java.lang.IllegalStateException: DBAppender cannot function if
the JDBC driver does not support getGeneratedKeys method *and* without a
specific SQL dialect

 

I read a little about SQLDialect, but I appear to be missing the part
that shows how to configure it, and there's no dialect for JTDS. Am I up
the creek here, or is this possible?

 

Thanks,

Eric


_________________________________________________
Don't gamble with your environmental information. Learn how the world's largest on-demand environmental information management system can help you mitigate your operating risk: www.locustec.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120321/64c90570/attachment.html>


More information about the Logback-user mailing list