Exemplo n.º 1
0
 /// <summary>
 /// 异常日志
 /// </summary>
 public void WriteLog(Common.Enums.enumOperator action, string message, Exception e)
 {
     _log.Fatal(Utils.GetIP(), this.CurrentUser.Name, Request.Url.ToString(), action.ToString(), message + e.Message, e);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 操作日志
        /// </summary>
        public void WriteLog(Common.Enums.enumOperator action, string message, Common.Enums.enumLog4net logLevel)
        {
            switch (logLevel)
            {
            case Common.Enums.enumLog4net.INFO:
                _log.Info(Utils.GetIP(), this.CurrentUser.Name, Request.Url.ToString(), action.ToString(), message);
                break;

            case Common.Enums.enumLog4net.WARN:
                _log.Warn(Utils.GetIP(), this.CurrentUser.Name, Request.Url.ToString(), action.ToString(), message);
                break;

            default:
                _log.Error(Utils.GetIP(), this.CurrentUser.Name, Request.Url.ToString(), action.ToString(), message);
                break;
            }
        }