You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mo...@Dell.com on 2007/05/22 15:12:02 UTC

JDBCAppender inserts %d instead of the date in the database

Hi All, 

I am trying to use the log4j.jdbcplus.jdbcappender to log my messages to
an oracle database. I am not getting any errors and data is being
inserted into the database except that instead of actual logs %c, %d, %p
and the like are being inserted. 

I have tried to use the jdbc.jdbcappender and that logs the messages
correctly in the database. 

The file below is my properties file. 

log4j.appender.D=org.apache.log4j.jdbcplus.JDBCAppender
log4j.appender.D.url=jdbc:oracle:thin:@dbname:1521:TSSD
log4j.appender.D.dbclass=oracle.jdbc.driver.OracleDriver
log4j.appender.D.username=user_name
log4j.appender.D.password=password
log4j.appender.D.sql=INSERT INTO SDR_EXCEPTIONS(CREATED_AT, CLASS_NAME,
PRIORITY, MESSAGE) VALUES ('%d{DATE}','%c','%p','%m')
log4j.appender.D.layout=org.apache.log4j.PatternLayout
log4j.appender.D.layout.ConversionPattern=[%t] %m
%l##%d{dd.MM.yyyy}#%d{HH:mm:ss} log4j.appender.D.layoutPartsDelimiter=#
log4j.appender.D.buffer=1
log4j.appender.D.commit=true
log4j.appender.D.quoteReplace=true
log4j.appender.D.throwableMaxChars=3000

I would appreciate any help

Thanks

Amin

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