log4j配置







value="%d{yyyy-MM-dd HH:mm:ss} %-5p [%t - %F:%L - %c] %m%n" />









class="org.apache.log4j.DailyRollingFileAppender">










class="org.apache.log4j.RollingFileAppender">












class="org.apache.log4j.FileAppender">






















指定日志输出:

	private final static Logger logger = Logger.getLogger("raily");


log4j.properties文件配置方式

log4j.logger.reclogger=DEBUG,rec
log4j.appender.rec=org.apache.log4j.RollingFileAppender
log4j.appender.rec.File=${catalina.home}/logs/rec/rec.log
log4j.appender.rec.MaxFileSize=500KB
log4j.appender.rec.MaxBackupIndex=5
log4j.appender.rec.layout=org.apache.log4j.PatternLayout
log4j.appender.rec.layout.ConversionPattern=%d{yyyyMMdd HH:mm:ss} %p %l [%t] %m%n

指定日志输出:

	private final static Logger logger = Logger.getLogger("reclogger");

你可能感兴趣的:(web应用)