在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; namespace HuaTong.General.Utility { /// <summary> /// 文件日志处理 需要log4net配置 /// </summary> public static class LogHelper { static LogHelper() { log4net.Config.XmlConfigurator.Configure(); } private static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("Logger"); private static readonly EventLog osEventLog = new EventLog(); private static readonly log4net.ILog logtrace = log4net.LogManager.GetLogger("LoggerTrace"); private static readonly log4net.ILog logcallback = log4net.LogManager.GetLogger("LoggerCallback"); /// <summary> /// 跟踪日志记录 /// </summary> public static void TraceLog(string info) { if (logtrace.IsInfoEnabled) { logtrace.Info(info); } } /// <summary> /// 回调日志记录 /// </summary> public static void CallbackLog(string info) { if (logcallback.IsInfoEnabled) { logcallback.Info(info); } } /// <summary> /// 操作日志记录 /// </summary> public static void Info(string info) { if (loginfo.IsInfoEnabled) { loginfo.Info(info); } } /// <summary> /// 错误日志记录 /// </summary> public static void Error(string info, Exception ex = null) { if (loginfo.IsErrorEnabled) { loginfo.Error(info, ex); } } } }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论