The following class is registered in the Windsor Castle container:
namespace MyNamespace
{
class Foo : IFoo
{
public Foo(ILog log)
{
_log = log;
}
...
}
}
ILog
is a log4net logger, currently registered like this:
Component.For<ILog>().UseFactoryMethod(
() => LogManager.GetLogger(Assembly.GetCallingAssembly().FullName));
I would like to create a logger named like the calling type (in this case "MyNamespace.Foo"
) rather than like the calling assembly. Is there a way to do it, except for using reflection to play with stack frames?