#1 定义了两个输出端
log4j.rootLogger = INFO, A1, A2,A3

#2 定义A1输出到控制器
log4j.appender.A1 = org.apache.log4j.ConsoleAppender
#3 定义A1的布局模式为PatternLayout
log4j.appender.A1.layout = org.apache.log4j.PatternLayout
#4 定义A1的输出格式
log4j.appender.A1.layout.ConversionPattern = %-4r [%t] %-5p %c - %m%n

#5 定义A2输出到文件
log4j.appender.A2 = org.apache.log4j.RollingFileAppender
#6 定义A2要输出到哪一个文件
log4j.appender.A2.File = F:\\nepalon\\classes\\example3.log
#7 定义A2的输出文件的最大长度
log4j.appender.A2.MaxFileSize = 1KB
#8 定义A2的备份文件数
log4j.appender.A2.MaxBackupIndex = 3
#9 定义A2的布局模式为PatternLayout
log4j.appender.A2.layout = org.apache.log4j.PatternLayout
#10 定义A2的输出格式
log4j.appender.A2.layout.ConversionPattern = %d{yyyy-MM-dd hh:mm:ss}:%p %t %c - %m%n

#11区 定义A3输出到数据库
log4j.appender.A3 = org.apache.log4j.jdbc.JDBCAppender
log4j.appender.A3.BufferSize = 40
log4j.appender.A3.Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
log4j.appender.A3.URL = jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=nepalon
log4j.appender.A3.User = sa
log4j.appender.A3.Password =
log4j.appender.A3.layout = org.apache.log4j.PatternLayout
log4j.appender.A3.layout.ConversionPattern = INSERT INTO log4j (createDate, thread, priority, category, message) values(getdate(), '%t', '%-5p', '%c', '%m')