I try to "pipe" my statement to an PostgreSQL via the DBAppender with the
Log4j-1.3
My configuration was the followng :
<appender name="DB" class="org.apache.log4j.db.DBAppender">
<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="xxx" />
<param name="password" value="xxx" />
</connectionSource>
</appender>
I keep on receiving the following message :
<snip>
DBAppender cannot function if the JDBC driver does not support getGeneratedKeys
method *and* without a specific SQL dialect
</snip>
I try to specify the dialect via various settings :
<appender name="DB" class="org.apache.log4j.db.DBAppender">
<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="xxx" />
<param name="password" value="xxx" />
<param name="dialect" value="1" /> <!-- or the string
POSTGRES_DIALECT as indicated int the ConnectionSource class -->
</connectionSource>
</appender>
Any idea how to set up the dialect in the configuration ... ?
Tx,
\T,
--
Any fool can write code that a computer can understand.
Good programmers write code that humans can understand.
Martin Fowler
T. : +32 (0)2 742 05 94
M. : +32 (0)497 44 68 12
@ : [EMAIL PROTECTED]
Do you skype too ... (callto://tsmets/) ?
----- Forwarded Message ----
From: Raymond DeCampo <[EMAIL PROTECTED]>
To: Thomas SMETS <[EMAIL PROTECTED]>
Sent: Saturday, April 1, 2006 4:21:40 AM
Subject: Re: Configuring the DBAppender with
org.apache.log4j.jdbc.JNDIConnectionSource
Thomas SMETS wrote:
>Dear,
>
>Trying to use the Log4j-1.3 possibility to write the statements to the DB with
>the DB appender, it seems that this would be an approriate syntax in my
>Log4j.xml (cfr. proposed syntax by Ray in the Javadoc :
>http://logging.apache.org/log4j/docs/api-1.3/org/apache/log4j/db/JNDIConnectionSource.html)
>
> <appender name="DB" class="org.apache.log4j.db.DBAppender">
> <connectionSource class="org.apache.log4j.jdbc.JNDIConnectionSource">
> <param name="jndiLocation" value="LogDS" />
> </connectionSource>
> </appender>
>
>But it doesn't seem to work & XML-validation complains that "connectionSource"
>must be declared & appender does not respect the (errorHandler?, param*,
>layout?, filter*, appender-ref*)
>
>Can someone tell me where I need to specify the declare the DataSource to use
>... ?
>
>
My recollection is that XML-validation and the log4j.xml configuration
file never worked well together. I'm basing that off my experience with
versions 1.2.x however; I imagine that the configuration may have
changed since then.
Sorry I couldn't of more help.
Ray
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]