Organize Piscal Service items
Add nlog, PiscalQueueManager modified: Core.Tests/Remote/PiscalSshClientTests.cs modified: Core/DAL/DataService.cs modified: Core/Remote/IPiscalClient.cs modified: Core/Remote/PiscalSshClient.cs new file: Web/Attributes/ActionLogAttribute.cs modified: Web/Controllers/ControllerBase.cs modified: Web/Controllers/LeafInputController.cs modified: Web/Controllers/LeafOutputController.cs new file: Web/NLog.config new file: Web/NLog.xsd new file: Web/Services/PiscalQueueManager.cs modified: Web/Services/PiscalService.cs modified: Web/Startup.cs modified: Web/Web.csproj modified: Web/packages.config Ignore logs Organize piscal queue manager modified: Core/Entities/LeafInputFile.cs modified: Web/Controllers/LeafInputController.cs renamed: Web/Startup.cs -> Web/HangfireStartup.cs modified: Web/Services/PiscalQueueManager.cs modified: Web/Web.csproj cleanup usings in leafinputcontroller
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using LeafWeb.Core.DAL;
|
||||
using NLog;
|
||||
|
||||
namespace LeafWeb.Web.Controllers
|
||||
{
|
||||
@@ -18,6 +17,20 @@ namespace LeafWeb.Web.Controllers
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
protected override void OnException(ExceptionContext filterContext)
|
||||
{
|
||||
if (filterContext?.Exception != null)
|
||||
{
|
||||
var controller = filterContext.RouteData.Values["controller"].ToString();
|
||||
var action = filterContext.RouteData.Values["action"].ToString();
|
||||
var loggerName = $"{controller}Controller.{action}";
|
||||
|
||||
LogManager.GetLogger(loggerName).Error(filterContext.Exception);
|
||||
}
|
||||
|
||||
base.OnException(filterContext);
|
||||
}
|
||||
|
||||
protected bool IsHttpParamActionMatch()
|
||||
{
|
||||
return ControllerContext.RouteData.Values["action"].ToString()
|
||||
@@ -42,6 +55,10 @@ namespace LeafWeb.Web.Controllers
|
||||
case StatusType.Error:
|
||||
TempData["StatusMessage-Type"] = "alert-error";
|
||||
break;
|
||||
case StatusType.Info:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(statusType), statusType, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user