Exemple #1
0
        /// <summary>
        /// 写入操作日志
        /// </summary>
        /// <param name="Module">模块编码 </param>
        /// <param name="ModuleName">模块名称</param>
        /// <param name="Message">异常信息</param>
        public static void OpLog(string Module, string ModuleName, string Message)
        {
            var IS_OPEN_PERMISSION = ConfigHelper.GetApp("IS_OPEN_FUNCATIONLOG");

            if (!string.IsNullOrEmpty(IS_OPEN_PERMISSION) && IS_OPEN_PERMISSION == "true")
            {
                try
                {
                    PlateLog.WriteOp(SessionConfig.UserId(), SessionConfig.UserName(),
                                     HttpContext.Current.Request.UserHostAddress, HttpContext.Current.Request.Url.ToString(),
                                     Message, PlateLog.LogMessageType.Info, Module, ModuleName);
                }
                catch (System.Exception ex)
                {
                    PlateLog.WriteInFile(SessionConfig.UserId(), SessionConfig.UserName(),
                                         HttpContext.Current.Request.UserHostAddress, HttpContext.Current.Request.Url.ToString(),
                                         Message, PlateLog.LogMessageType.Error, ex);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Action操作后处理:日志
 /// </summary>
 /// <param name="filterContext"></param>
 public void OnActionExecuted(ActionExecutedContext filterContext)
 {
     //var f=filterContext.ActionDescriptor.GetParameters();
     PlateLog.WriteOp(SessionConfig.UserId(), SessionConfig.UserName(), SessionConfig.CurrentIP(), HttpContext.Current.Request.Url.AbsoluteUri, filterContext.ActionDescriptor.ActionName, PlateLog.LogMessageType.Info, Module, ModuleName);
 }