title: log4j logs to mysql table
body: <p>I would like to insert the logs into a log table. and the setting op log4j.properties :</p>
  
  <pre><code>log4j.rootLogger = DEBUG, DB
  log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender
  log4j.appender.DB.URL=jdbc:mysql://localhost/test
  log4j.appender.DB.driver=com.mysql.jdbc.Driver
  log4j.appender.DB.user=admin
  log4j.appender.DB.password=admin
  log4j.appender.DB.sql=INSERT INTO logs_2 (log) VALUES('%t')
  log4j.appender.DB.layout=org.apache.log4j.PatternLayout
  </code></pre>
  
  <p>and I have tried also</p>
  
  <pre><code>INSERT INTO logs_2 (log) VALUES(''%t'')
  INSERT INTO logs_2 (log) VALUES('this is an example log ')
  INSERT INTO 'logs_2' (log) VALUES('this is an example log')
  </code></pre>
  
  <p>the table definition:</p>
  
  <pre><code> CREATE TABLE `logs_2` (
      `id` int(6) unsigned NOT NULL AUTO_INCREMENT,
      `log` varchar(200) DEFAULT NULL,
       PRIMARY KEY (`id`)
   ) ENGINE=InnoDB 
  
  DEFAULT CHARSET=utf8 |
  </code></pre>
  
  <p>and the results:mysql>....command line....</p>
  
  <pre><code>MariaDB [test]&gt; select * from logs_2;
  Empty set (0.00 sec)
  </code></pre>
  
  <p>what is wrong in with script??</p>