I use the newest Castle Windsor container and I would like to create a logger, which will write to file what I want but also write the caller assembly name. So here is an example:
namespace Core.Datalayer
{
public class Foo
{
public Foo(ILogger logger)
{
logger.Write("test line");
}
}
}
The container gives the instance correctly, but I cannot figure out how can I determine the Caller assembly name or the Caller class name? I would like that the logger writing to file something like this:
"assembly Core.Datalayer- test line"
Is there any possibility to determine that where instantiated the ILogger interface?
I tried the Assembly.GetCallingAssembly() but is always Castle.Core because the stack is full with Castle.Core calls.