Dear,
I try to use Log4J new DBAppender (cfr. the config file herebelow) but
it keeps on complaining with the following message :
Reported error: "Exception in Action for tag <appender>" at line 20
column -1
java.lang.IllegalStateException: DBAppender cannot function if the JDBC
driver does not support getGeneratedKeys method *and* without a specific
SQL dialect
at org.apache.log4j.db.DBAppender.activateOptions(DBAppender.java:179)
As I cannot get the information out of the ML's of Log4J ( Log4J Users
List <log4j-user@logging.apache.org>,
ML log4j dev <log4j-dev@logging.apache.org> ) on how to set the
SQL_DIALECT variable .... I was wandering if the postgresql driver
allowed for getGeneratedKeys....
I was wandering if I needed to use the "jxDBCon-Open Source JDBC driver
framework" available here : http://jxdbcon.sourceforge.net/ ... ?
Tx,
\T,
--
Thomas Lionel SMETS
rue J. Wytsmanstraat 62
1050 Brussels
T : +32 (0)2 742 05 94
M : +32 (0)497 44 68 12
@ : duvelbier-tsmets@yahoo.com
Do you skype (callto://tsmets) ?
<snip>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration
debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="DB" class="org.apache.log4j.db.DBAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
</layout>
<connectionSource
class="org.apache.log4j.db.DriverManagerConnectionSource">
<param name="driver" value="org.postgresql.Driver" />
<param name="url"
value="jdbc:postgresql://localhost:5432/Log4j" />
<param name="username" value="xyz" />
<param name="password" value="xyz" />
<param name="dialect" value="POSTGRES_DIALECT" />
</connectionSource>
</appender>
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
</layout>
</appender>
<root>
<level value ="debug"/>
<appender-ref ref="Db" />
</root>
<logger name="com">
<level value="debug" />
<appender-ref ref="STDOUT" />
</logger>
</log4j:configuration>
</snip>