Add cancel
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using log4net;
|
||||
using LeafWeb.Core.DAL;
|
||||
using Umbraco.Web.Mvc;
|
||||
@@ -21,9 +22,7 @@ namespace LeafWeb.WebCms.Controllers
|
||||
{
|
||||
if (filterContext?.Exception != null)
|
||||
{
|
||||
var controller = filterContext.RouteData.Values["controller"].ToString();
|
||||
var action = filterContext.RouteData.Values["action"].ToString();
|
||||
var loggerName = $"LeafWeb.WebCms.Controllers.{controller}Controller.{action}";
|
||||
var loggerName = LoggerName(filterContext.RouteData);
|
||||
|
||||
LogManager.GetLogger(loggerName).Error(filterContext.Exception);
|
||||
}
|
||||
@@ -31,12 +30,14 @@ namespace LeafWeb.WebCms.Controllers
|
||||
base.OnException(filterContext);
|
||||
}
|
||||
|
||||
protected bool IsHttpParamActionMatch()
|
||||
protected string LoggerName(RouteData routeData)
|
||||
{
|
||||
return ControllerContext.RouteData.Values["action"].ToString()
|
||||
.Equals("Action", StringComparison.InvariantCultureIgnoreCase);
|
||||
var controller = RouteData.Values["controller"].ToString();
|
||||
var action = RouteData.Values["action"].ToString();
|
||||
return $"LeafWeb.WebCms.Controllers.{controller}Controller.{action}";
|
||||
}
|
||||
|
||||
// Status messages to pages
|
||||
protected enum StatusType
|
||||
{
|
||||
Info,
|
||||
|
||||
Reference in New Issue
Block a user