/// <summary> /// 写普通耗时日志(方法名哈希为logtag) /// </summary> /// <param name="msg"></param> public void Write(string methodname, string msg) { EnumTimeWatchLogType type = EnumTimeWatchLogType.Common; Write(new TimeWatchLogInfo() { fromip = "", logtype = type, logtag = methodname.GetHashCode(), url = methodname.SubString2(90), msg = msg, remark = "", sqlip = "", }); }
/// <summary> /// 写普通耗时日志(url哈希为logtag) /// </summary> /// <param name="msg"></param> public void Write(string msg) { EnumTimeWatchLogType type = EnumTimeWatchLogType.Common; string url = ""; try { url = ((System.Web.HttpContext.Current != null) ? (System.Web.HttpContext.Current.Request.GetDisplayUrl().SubString2(90)) : ""); } catch { } Write(new TimeWatchLogInfo() { fromip = "", logtype = type, logtag = url.GetHashCode(), url = url, msg = msg, remark = "", sqlip = "", }); }