#将日志写到文件
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=e\:\\log\\zmcc.log
log4j.appender.file.DatePattern=yyyy-MM-dd-HH-mm'.log'
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.threshold=error
log4j.appender.file.layout.ConversionPattern=[%d] [%t] (%F:%L) %-5p %c - %m%n
log4j.appender.file.encoding=UTF-8 log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=[%d] [%t] (%F:%L) %-5p %c - %m%n
log4j.appender.console.encoding=UTF-8 log4j.appender.html=org.apache.log4j.DailyRollingFileAppender
log4j.appender.html.File=log4j.log
log4j.appender.html.layout=org.apache.log4j.HTMLLayout # 将日志发送到email
log4j.logger.MailLog=WARN,A5
log4j.appender.A5=org.apache.log4j.net.SMTPAppender
log4j.appender.A5.BufferSize=5
#收件人名称,多个人以逗号隔开
log4j.appender.A5.To=
#发件人
log4j.appender.A5.From=
#登录名
log4j.appender.A5.SMTPUsername=
#邮件密码
log4j.appender.A5.SMTPPassword=
log4j.appender.A5.Subject=ErrorLog
log4j.appender.A5.Encoding=UTF-8
log4j.appender.A5.SMTPHost=smtp.exmail.qq.com
log4j.appender.MAIL.Threshold=ERROR
# 缓存文件大小,日志达到250K时发送Email
log4j.appender.MAIL.BufferSize=250
log4j.appender.A5.layout=org.apache.log4j.PatternLayout
log4j.appender.A5.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n log4j.rootLogger=error,console,A5
log4j.logger.com.lzb=debug
log4j.logger.com.ibatis=DEBUG,info
发送邮件需要一如两个包:mail.jar,activation.jar
邮件包下载地址:http://pan.baidu.com/s/1c0nWuxa