logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <nore...@qos.ch>
Subject Re: JNDI datasource:
Date Thu, 22 Apr 2004 20:34:18 GMT
Hi Matt,

Your request is a very reasonable requirement that we should really support.

At 12:45 AM 4/22/2004, Matthew Arveson wrote:
>I have been using log4j to write logging statements to text files, but I 
>would like to switch to a DB.  I have the DB set up, and the following 
>works great:
>
>log4j.appender.a=org.apache.log4j.jdbc.JDBCAppender
>log4j.appender.a.URL=jdbc:mysql://abcde/logs
>log4j.appender.a.user=user
>log4j.appender.a.password=password
>log4j.appender.a.sql=insert into my_table (log_date, log_time, log_level, 
>diag_cont, log_message) VALUES ('%d{yyyy-MM-dd}', '%d{HH:mm:ss}', '%p', 
>'%x', '%m')
>
>However, I would like to specify a JNDI datasource instead.  I would like 
>to do the following:
>
>log4j.appender.a=org.apache.log4j.jdbc.JDBCAppender
>log4j.appender.a.datasource=jdbc/logs
>log4j.appender.a.sql=insert into my_table (log_date, log_time, log_level, 
>diag_cont, log_message) VALUES ('%d{yyyy-MM-dd}', '%d{HH:mm:ss}', '%p', 
>'%x', '%m')
>
>Is something like this possible?
>
>Matt

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message