IoC containers like Ninject expose the “activation context” in factory methods that allows the creator to understand the context in which the instance is being created. My specific pratical need is the following:
No, that information doesn’t exist in the impl or any of the APIs and would prohibitive to add, tightly coupled and inefficient to create per dependency.
If you want to the logging injected with the type you would need to inject the factory and create the instance from that, which you can do lazily with something like:
ILog log;
public ILogFactory LogFactory { get; set; }
public ILog Log => log ?? (log = LogFactory.GetLogger(GetType()));
Which can also be added to a base class if preferred.