logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <duvelbier-tsm...@yahoo.com>
Subject Configuring the Log4J -1.3 DBAppender with org.apache.log4j.db.DriverManagerConnectionSource
Date Sat, 22 Apr 2006 15:02:35 GMT
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 
@ : duvelbier-tsmets@yahoo.com 
Do you skype too ... (callto://tsmets/) ? 


----- Forwarded Message ----
From: Raymond DeCampo <rdecampo@twcny.rr.com>
To: Thomas SMETS <smetsthomas@yahoo.com>
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message