I am trying to implement AOP using StructureMap and Castle.Core. I am using the latest versions.
I am able to make it with the default constructor, but what I need to inject the logger into the constructor of the IInterceptor. How can I do this.
public class IwInterceptor : IInterceptor
{
private readonly IwLogger logger;
public IwInterceptor(IwLogger logger)
{
this.logger = logger;
}
public void Intercept(IInvocation invocation)
{
logger.Debug("Entered " + invocation.Method.Name);
invocation.Proceed();
logger.Debug("Left");
}
}