I created a custom LogFilterAttribute and I want to inject the ILog object into the Logger property. When I debug the project the property Logger of the ActionFilterAttribute is null.
public class LogFilterAttribute : ActionFilterAttribute
{
/// <summary>
/// Get or sets the value of the logger object
/// </summary>
public ILog Logger { get; internal set; }
//some loggging with the Logger Property in the overriden methods
}
I register the injection in the NinjectWeCommon.cs in the method RegisterServices.
kernel.Bind<LogFilterAttribute>().ToSelf().WithPropertyValue("Logger", LogManager.GetLogger(typeof(Global)));
When I'm attached to the debugger in the LogFilterAttribute the property Logger is null. How can I solve this issue?
(The configuration is set in the web.config)
greetings