Exemple #1
0
        /// <summary>
        /// 添加操作日志
        /// </summary>
        public void InsertLog(SqlTransaction trans, Exception ex)
        {
            ErrorModel errModel = new ErrorModel();

            errModel.Message         = ex.Message.ToString2();
            errModel.InnerException  = ex.InnerException.ToString2();
            errModel.StackTrace      = ex.StackTrace.ToString2();
            errModel.Source          = ex.Source.ToString2();
            errModel.TargetSite      = ex.TargetSite.ToString2();
            errModel.RequestUrl      = HttpContext.Current.Request.Url.ToString2();
            errModel.RequestMethod   = HttpContext.Current.Request.HttpMethod.ToString2();
            errModel.UrlReferrer     = HttpContext.Current.Request.UrlReferrer.ToString2();
            errModel.UserAgent       = HttpContext.Current.Request.UserAgent.ToString2();
            errModel.UserHostAddress = HttpContext.Current.Request.UserHostAddress.ToString2();
            errModel.CreationDate    = DateTimeOffset.Now;
            errDAL.InsertInfo(trans, errModel);
        }
Exemple #2
0
/// <summary>
/// 插入信息
/// </summary>
        public int InsertInfo(SqlTransaction trans, ErrorModel errModel)
        {
            return(errDAL.InsertInfo(trans, errModel));
        }