More Progress
This commit is contained in:
@@ -9,12 +9,12 @@ namespace MileageTraker.Web.Utility
|
||||
{
|
||||
if (filterContext != null)
|
||||
{
|
||||
string controller = filterContext.RouteData.Values["controller"].ToString();
|
||||
string action = filterContext.RouteData.Values["action"].ToString();
|
||||
string loggerName = string.Format("{0}Controller.{1}", controller, action);
|
||||
string @params = string.Join(", ", filterContext.ActionParameters.Select(i => i.Key + ": " + i.Value));
|
||||
var controller = filterContext.RouteData.Values["controller"].ToString();
|
||||
var action = filterContext.RouteData.Values["action"].ToString();
|
||||
var loggerName = string.Format("{0}Controller.{1}", controller, action);
|
||||
var @params = string.Join(", ", filterContext.ActionParameters.Select(i => i.Key + ": " + i.Value));
|
||||
|
||||
string hostAddress = "UserHostAddress: " + filterContext.HttpContext.Request.UserHostAddress;
|
||||
var hostAddress = "UserHostAddress: " + filterContext.HttpContext.Request.UserHostAddress;
|
||||
|
||||
log4net.LogManager.GetLogger(loggerName).Info(hostAddress + ", " + @params);
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace MileageTraker.Web.Utility
|
||||
{
|
||||
public class RequireRequestValueAttribute : ActionMethodSelectorAttribute
|
||||
{
|
||||
public RequireRequestValueAttribute(string valueName)
|
||||
{
|
||||
ValueName = valueName;
|
||||
}
|
||||
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
|
||||
{
|
||||
return (controllerContext.HttpContext.Request[ValueName] != null);
|
||||
}
|
||||
public string ValueName { get; private set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user