string filePath = HttpContext.Current.Server.MapPath("~/log4net.config"); FileInfo fileInfo = new FileInfo(filePath); XmlConfigurator.ConfigureAndWatch(fileInfo);
Logger.Info("--------------------------------------------------------------"); Logger.Info(" test log"); Logger.Info("--------------------------------------------------------------");
原文:http://www.cnblogs.com/shiningrise/p/6696230.html