I'm trying to integrate log4j logging to an existing MYSQL-based
struts application and am running into a configuration issue with how I have log4j configured in my system. I have a basic requirement to log messages to a system_log table. Basically, I did the following:
1) Created a SYSTEM_LOG table in my database with one column (MESSAGES which is a VARCHAR2(1000)).
2) Put the log4j jar file in the WEB-ING/lib directory.
3) Created a log4j.properties file that sits in the usual classes directory (with all my other properties files). This file looks like the following:
log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.R.driver=com.mysql.jdbc.Driver
log4j.appender.R.URL=jdbc:mysql://localhost/product
log4j.appender.R.user=user
log4j.appender.R.password=password
log4j.appender.R.sql=INSERT INTO SYSTEM_LOG (Message) VALUES ('%c - %p - %m')
log4j.appender.R.layout=org.apache.log4j.PatternLayout I get the following error when I startup
Tomcat:
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'taglib'')' at line 1 I believe my SQL syntax is correct in the properties file, but I'm not sure why there is an error and certainly not sure where 'taglib' comes into play.
Does anyone have any ideas on this?
Thanks,
Scott