Esempio n. 1
0
 /// <summary>
 /// 请求执行前
 /// </summary>
 /// <param name="filterContext"></param>
 void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
 {
     if (HttpLogEnabled)
     {
         SystemExtends.LogWrite("IP:{0}-Controller:{1}-Action:{2}"
                                .format(Text.NetworkIp, filterContext.ActionDescriptor.ControllerDescriptor.ControllerName, filterContext.ActionDescriptor.ActionName), "HttpLog");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 输出日志
 /// </summary>
 /// <param name="sql"></param>
 /// <param name="msg"></param>
 /// <param name="_entity"></param>
 private void LogWrite(string sql, string msg, object _entity)
 {
     //SQLLog is true
     if (this.SqlLogEnabled)
     {
         string text = " sql: {0} \r\n msg:{1} \r\n entity: {2}";
         try
         {
             SystemExtends.LogWrite(text.format(sql, msg, _entity.ToJson()), "SqlLog");
         }
         catch (Exception)
         {
         }
     }
 }