log4j.rootLogger=DEBUG,FILE,MAIL
log4j.addivity.org.apache=true
log4j.appender.CONSOLE1=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
log4j.appender.CONSOLE1.Target=System.out
log4j.appender.CONSOLE1.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %5l [%5p] - %m%n
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.Threshold=ERROR
log4j.appender.FILE.File=file.log
log4j.appender.FILE.Append=true
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %5l [%5p] - %m%n
#邮件发送
# log4j的邮件发送appender,如果有必要你可以写自己的appender
log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
#发送邮件的门槛,仅当等于或高于ERROR(比如FATAL)时,邮件才被发送
log4j.appender.MAIL.Threshold=ERROR
#邮件缓冲区大小
log4j.appender.MAIL.BufferSize=1024
#发送邮件的邮箱帐号
log4j.appender.MAIL.From=xxx@qq.com
#邮件接收着
log4j.appender.MAIL.To=xxx@qq.com,xxx@qq.com,xxx@qq.com
#SMTP邮件发送服务器地址
log4j.appender.MAIL.SMTPHost=smtp.qq.com
#SMTP发送认证的帐号名
log4j.appender.MAIL.SMTPUsername=xxx.com
#SMTP发送认证帐号的密码
log4j.appender.MAIL.SMTPPassword=xxxx
#是否打印调试信息,如果选true,则会输出和SMTP之间的握手等详细信息
log4j.appender.MAIL.SMTPDebug=true
#邮件主题
log4j.appender.MAIL.Subject=log4j
log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=[ErrorMessage] %d{yyyy-MM-dd HH:mm:ss.SSS} %5l [%5p] - %m%n