/// <summary> /// 添加日志 /// </summary> /// <param name="msg">日志内容</param> /// <param name="type">0错误,1消息,2同步,3操作日志,500服务器端错误,404更新服务消息</param> public static void AddLog(string msg, int type, string username) { BLL.Log bll = new BLL.Log(); bll.created = DateTime.Now; bll.describe = msg; bll.detail = ""; bll.ip = ""; bll.source = ""; bll.type = type; bll.username = username; bll.insert(bll); }
/// <summary> /// 添加日志 /// </summary> /// <param name="msg">日志内容</param> /// <param name="type">0错误,1消息,2同步,500服务器端错误,404更新服务消息</param> public static void AddLog(string msg, int type) { try { BLL.Log bll = new BLL.Log(); bll.created = DateTime.Now; bll.describe = msg; bll.detail = ""; bll.ip = ""; bll.source = ""; bll.type = type; bll.insert(bll); } catch (Exception ex) { System.IO.File.AppendAllText(Environment.CurrentDirectory + "\t.txt", ex.ToString()); } }
public static void AddLog(string msg, int type) { BLL.Log bll = new BLL.Log(); bll.created = DateTime.Now; bll.describe = msg; bll.detail = ""; if (HttpContext.Current == null) { bll.ip = "local"; bll.source = "AutoSupplyManage_YSPT"; } else { bll.ip = HttpContext.Current.Request.UserHostAddress; bll.source = HttpContext.Current.Request.Url.ToString(); } bll.type = type; bll.insert(bll); }
private void InsertLog(Model.Log model) { BLL.Log bllLog = new BLL.Log(); model.LogType = "添加游戏"; model.Description = "添加游戏成功"; model.LogTime = DateTime.Now; model.IsRead = "未阅读"; bllLog.Add(model); }