using System; using System.IO; namespace ZJ_BYD.Untils { public class LogHelper { private LogHelper() { } public static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo"); public static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror"); public static void SetConfig() { log4net.Config.XmlConfigurator.Configure(); } public static void SetConfig(FileInfo configFile) { log4net.Config.XmlConfigurator.Configure(configFile); } public static void WriteLog(string info) { loginfo.Info(info); } public static void WriteErrorLog(string info, Exception se=null) { logerror.Error(info, se); } } }