连接数据库出错的日志为什么没有输出到日志文件中?
log4j.properties
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%r [%t] %-5p %C.%M() - %m%n
log4j.rootLogger=debug, A1,R
# Set root logger level to DEBUG and its only appender to A1.
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.File=D:/t.log
log4j.appender.R.Append=true
log4j.appender.R.MaxFileSize=500KB
log4j.appender.R.DatePattern = '. 'yyyy-MM-dd '.txt '
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n
log4j.category.org.apache.cactus = WARN
log4j.category.servletunit = WARN
log4j.category.org.apache.commons.beanutils = ERROR
连接数据库出错的日志 在控制台可以显示出来,但是日志文件不能显示出来,
------解决方案--------------------log4j.appender.R=org.apache.log4j.ConsoleAppender去掉