62,243
社区成员




LogAttribute : System.Web.Http.Filters.ActionFilterAttribute
if (actionExecutedContext.Exception == null)
{
var par = Newtonsoft.Json.JsonConvert.SerializeObject(actionExecutedContext.ActionContext.ActionArguments);
if (string.IsNullOrEmpty(Type))
{
var cName = actionExecutedContext.ActionContext.ControllerContext.Controller.ToString().Split('.').Last();
var aName = actionExecutedContext.ActionContext.ActionDescriptor.ActionName;
Type = cName + "." + aName;
}
var result = "";
if (actionExecutedContext.Response.Content != null)
{
result = actionExecutedContext.Response.Content.ReadAsStringAsync().Result;
}
var post = await actionExecutedContext.Request.Content.ReadAsStringAsync();
Log.Client.RedisLogHelper.LogAdd(par + "\n" + post, Type, result);
}
base.OnActionExecuted(actionExecutedContext);