Hi Folks,

I am trying to use JDBC appender  with mysql with log4j and getting the
following error.

Here is the configuration file:

log4j.rootLogger= DEBUG, R
log4j.appender.R=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.R.URL=jdbc:mysql://localhost/abhijeetlogs
log4j.appender.R.user=root
log4j.appender.R.password=""
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n %l
log4j.appender.R.sql=INSERT INTO logstatments (warnStatement) VALUES
('%d [%t]
%-5p %c - %m%n %l')

I have put "mysql-connector-java-2.0.14-bin.jar" in classpath. But when
I try to
use it , I get the following exception:

log4j:ERROR Failed to excute sql
java.sql.SQLException: No suitable driver
 at java.sql.DriverManager.getConnection(DriverManager.java:532)
 at java.sql.DriverManager.getConnection(DriverManager.java:172)
 at
org.apache.log4j.jdbc.JDBCAppender.getConnection(JDBCAppender.java:197)
 at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:160)
 at
org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:235)
 at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:131)
 at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
 at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)

 at org.apache.log4j.Category.callAppenders(Category.java:187)
 at org.apache.log4j.Category.forcedLog(Category.java:372)
 at org.apache.log4j.Category.info(Category.java:674)
 at TestInfect1.<init>(TestInfect1.java:21)
 at TestInfect1.main(TestInfect1.java:65)


Has anybody tried using mysql with log4j??

abhijeet


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to