|
在输出到数据库和文件时遇到一个奇怪的问题,以下配置文件在java项目中运行没有问题,但是在整合SSH的时候就会报SQL异常,找了很久,请教很多人才解决了这个问题,就是SQL语句中的%m需要加上" "到现在都不知道为什么?
log4j.logger.com.vacant.daoimpl.newsmess.NewsMessDaoImpl=debug,info,db
log4j.appender.db=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.db.Threshold=db
log4j.appender.db.driver=com.mysql.jdbc.Driver
log4j.appender.db.URL=jdbc\:mysql\://127.0.0.1\:3306/vacant_room
#log4j.appender.db.bufferSize=1
log4j.appender.db.user=root
log4j.appender.db.password=root
log4j.appender.db.sql=insert into ss_auditlog (LOG_Name,CONTENT,CLASS_NAME,LOG_TIME,MEMO,usertype) values ('%X{moName}',%m,'%C','%d{yyyy-MM-dd HH\:mm\:ss}','%p','%X{useCard}')
log4j.appender.db.layout=org.apache.log4j.PatternLayout
log4j.logger.NewsMessDaoImpl=debug,info,news
log4j.appender.news = org.apache.log4j.DailyRollingFileAppender
log4j.appender.news.threshold =A1
log4j.appender.news.Encoding=UTF-8
log4j.appender.news.DatePattern = '.'yyyy-MM-dd'.log'
log4j.appender.news.File =d:/myfuse.log
log4j.appender.news.Append = false
log4j.appender.news.layout = org.apache.log4j.PatternLayout
log4j.appender.news.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%F:%L : %m%n%x |
|