using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Ant.Common { public class LoggerHelper { private static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo"); private static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror"); private static readonly log4net.ILog logmonitor = log4net.LogManager.GetLogger("logmonitor"); public delegate void SaveApiMonitorLog(string str); public static void Error(string ErrorMsg, Exception ex = null) { if (ex != null) { logerror.Error(ErrorMsg, ex); } else { logerror.Error(ErrorMsg); } //SaveApiMonitorLog save = logerror.Error; //save.BeginInvoke(ErrorMsg, ex, null, null); } public static void Info(string Msg) { SaveApiMonitorLog save = loginfo.Error; save.BeginInvoke(Msg, null, null); ///loginfo.Info(Msg); } public static void Monitor(string Msg) { //logmonitor.Info(Msg); SaveApiMonitorLog save = logmonitor.Info; save.BeginInvoke(Msg, null, null); } } }