Closed trampster closed 2 years ago
Currently stronginject have no knowledge of why they're being resolved. I would like to provide a solution to this, but it is not a priority at the moment.
In the meantime, I would suggest using Microsoft.Extensions.Logging.ILogger
I know changing everything may not be practical. I will try to think of a way to intercept a resolution and inject some extra information.
I have proposed a design at https://github.com/YairHalberstadt/stronginject/issues/109#issuecomment-883068923. Please take a look and let me know what you think! Thanks!
CLosing as duplicate of #109
We use serilog for logging and it needs to be initialised with the type of the object it will be logging for (the type it is injected into)
ILogger specificLogger = logger.ForContext(typeof(Parent))
Our types have the ILogger as constructor arguments and out current injection framework creates them for us with the correct context.
I can't see anyway to achieve this with stronginject Factories