Пример #1
0
 /// <summary>
 /// 写入系统请求日志(用户操作记录)
 /// </summary>
 /// <param name="logContent"></param>
 /// <param name="level">日志等级   1:错误  2:警告  3:正常</param>
 public void WriteRequestLog(long userid, int logType, string bussiesValue = "", string remark = "")
 {
     Task.Run(() =>
     {
         try
         {
             var requestLog = new SYS_RequestLog
             {
                 ID            = Guid.NewGuid().ToString(),
                 UserID        = userid,
                 LogType       = logType.ToString(),
                 LogTypeName   = EnumModel.GetEnumDesc((EnumModel.LogType)logType),
                 BussiessValue = bussiesValue,
                 CreatedUserID = userid,
                 UpdateUserID  = userid,
                 CreatedTime   = DateTime.Now,
                 UpdateTime    = DateTime.Now,
                 Remark        = remark
             };
             commonDal.Add(requestLog);
         }
         catch (Exception ex)
         {
             //log error
         }
     });
 }