public static void WriteLog(string msg, CHENGTUAN.Entity.ExceptionPostion position, CHENGTUAN.Entity.ExceptionRank rank) { IExceptionManager manager = CreateExceptionManager(); CHENGTUAN.Entity.ExceptionInfo info = new CHENGTUAN.Entity.ExceptionInfo(); StringBuilder sb = new StringBuilder(); info.Body = msg; info.ExceptionPosition = position; info.ExceptionRank = rank; info.Num = 1; info.Title = msg; manager.WriteLog(info); }
/// <summary> /// 常用日志操作 /// </summary> /// <param name="msg"></param> /// <param name="ex"></param> public static void WriteLog(string msg, Exception ex, CHENGTUAN.Entity.ExceptionPostion position, CHENGTUAN.Entity.ExceptionRank rank) { WriteLog(msg, ex, position, rank, 1000); }
public static void WriteLog(string msg, Exception ex, CHENGTUAN.Entity.ExceptionPostion position, CHENGTUAN.Entity.ExceptionRank rank, int num) { IExceptionManager manager = CreateExceptionManager(); CHENGTUAN.Entity.ExceptionInfo info = new CHENGTUAN.Entity.ExceptionInfo(); StringBuilder sb = new StringBuilder(); sb.Append(ex.Message + "\r\n"); sb.Append(ex.Source + "\r\n"); sb.Append(ex.StackTrace + "\r\n"); info.Body = sb.ToString(); info.ExceptionPosition = position; info.ExceptionRank = rank; info.Num = num; info.Title = msg; manager.WriteLog(info); }