logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Arveson" <Matthew.Arve...@cusys.edu>
Subject JNDI datasource:
Date Wed, 21 Apr 2004 22:45:39 GMT
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

---------------------------------------------------------------------
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