1234567891011121314151617181920 |
- using log4net.Config;
-
- using System;
- using System.IO;
-
- namespace Common.system
- {
- public class LogHelper
- {
- public static readonly log4net.ILog Loginfo = log4net.LogManager.GetLogger("loginfo");
- public static readonly log4net.ILog Logerror = log4net.LogManager.GetLogger("logerror");
-
- public static void InitLog4Net()
- {
- var logCfg = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + "log4net.config");
- XmlConfigurator.ConfigureAndWatch(logCfg);
- Loginfo.Info("日志初始化");
- }
- }
- }
|