Skip site navigation (1) Skip section navigation (2)

Re: Log4j Appender

From: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Log4j Appender
Date: 2009-03-21 03:37:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
nenad(dot)jaksic(at)imail(dot)de wrote:
> Hello,
> I'd like to use DBAppender or JDBCAppender to log to Postgres
> DB, I am not sure if any can send me some peace of code or clue or link
> how to do it. I also use Hibernete so I know
> there is also way to connect it to Hibernate to but preference 
> is to make it with Log4j anyhow. 
> Does somebody knows the  correct way?

This works for me:

create table log4j_messages
    message  varchar(2000),
    class    varchar(255),
    priority varchar(64),
    log_date timestamp
### JDBC appender
# timestamp comes out like this: 2009-03-20 22:16:45,614
log4j.appender.jdbc.sql=INSERT INTO log4j_messages (message, class, 
priority, log_date) values ('%m', '%c', '%p', to_timestamp('%d', 

Guy Rouillier

In response to


pgsql-jdbc by date

Next:From: r.trommer@open-factory.orgDate: 2009-03-21 23:06:56
Subject: Understanding PGInterval
Previous:From: Richard BroersmaDate: 2009-03-21 02:41:37
Subject: Re: PostgreSQL versioning for ORM was: Hibernate, JBoss, PostgreSQL, timestamp read doesn't match during update

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group