10 messages in org.apache.logging.log4j-userJDBCAppender: WHat am I doing wrong?
FromSent OnAttachments
James StaufferMay 11, 2004 11:04 am 
James StaufferMay 11, 2004 11:27 am 
Ceki GülcüMay 12, 2004 12:24 am 
James StaufferMay 12, 2004 6:49 am 
Ceki GülcüMay 12, 2004 7:21 am 
James StaufferMay 12, 2004 7:50 am 
Frank BurnsJun 5, 2004 4:23 pm 
Andreas GutherJun 6, 2004 8:54 am 
Frank BurnsJun 6, 2004 12:08 pm 
Frank BurnsJun 6, 2004 5:42 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:JDBCAppender: WHat am I doing wrong?Actions...
From:Frank Burns (fran@the-hub.demon.co.uk)
Date:Jun 5, 2004 4:23:44 pm
List:org.apache.logging.log4j-user

Can anyone please tell me what am I doing wrong?

I'm trying to set up the JDBCAppender but don't get anything logged to the database. I can't figure out what's wrong. I've even got Ceki's manual, but it's not covered.

Here's part of my config file: ==============================

##### For sysadmin.databaselogging, assign a logging level of INFO and add a JDBCAppender to it ##### log4j.logger.sysadmin.databaselogging = INFO, R5

# JDBC appender log4j.appender.R5=org.apache.log4j.jdbc.JDBCAppender log4j.appender.R5.BufferSize=4096 log4j.appender.R5.Driver=com.mysql.jdbc.Driver log4j.appender.R5.URL=jdbc:mysql://localhost/mydb log4j.appender.R5.user=frank log4j.appender.R5.password=banana log4j.appender.R5.layout=org.apache.log4j.PatternLayout log4j.appender.R5.layout.ConversionPattern=INSERT INTO Logs (Date, Logger, Priority, Message) VALUES ('%d', '%c', '%p', '%m') log4j.appender.R5.threshold=INFO

Here's the mySQL database table: ================================

CREATE TABLE Logs( Date VARCHAR(255), Logger VARCHAR(255), Priority VARCHAR(255), Message TEXT ) TYPE = InnoDB;

Here's relevant bits of code: ============================= ... static Logger databaseLogger = Logger.getLogger("sysadmin.databaselogging"); ... databaseLogger.info("System Administrator has just signed on."); ...

Any ideas?

Thanks,

Frank.