#日志名称 log4j.logger.xxx=ERROR, ErrorNetworkAppender
#定义appender log4j.appender.ErrorNetworkAppender = org.apache.log4j.DailyRollingFileAppender log4j.appender.ErrorNetworkAppender.file= ${catalina.home}/xxxNetwork.log log4j.appender.ErrorNetworkAppender.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.ErrorNetworkAppender.Threshold = WARN log4j.appender.ErrorNetworkAppender.layout=org.apache.log4j.PatternLayout log4j.appender.ErrorNetworkAppender.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-4r %-5p [%t] %37c %15M %3x - %m%n log4j.appender.ErrorNetworkAppender.encoding=UTF-8
----------------------------------------- 程序里这样调即可 private static final Logger loggerNetwork = LoggerFactory.getLogger("xxx");
|