tschettler commented on pull request #73: URL: https://github.com/apache/logging-log4net/pull/73#issuecomment-954420832
@fluffynuts thanks again for the response and great idea! I think we are in agreement. I like the idea of log4net having its own container, and allowing services to be registered within that container. I agree that a minimalist approach is probably best to start. I think the risks you mentioned are effectively mitigated with this approach and, if implemented correctly, third parties will not really be able to change how services are constructed since that would all be either in the "user-land" or within log4net. They could add service registrations of their own, but if they are not dependencies within an expected type registered with log4net, log4net would never construct them. I see this type of factory method as highly desirable: ```cs Log4NetContainer.Instance.Register<IService>(() => container.Resolve<IService>()); ``` In my opinion, this factory approach will probably be the most beneficial, and with the aim to provide a minimalist implementation, it would be less impactful to just support transient or singleton scoped instances from the start. Dealing with scoped services can (as you know) much more easily lead to captive dependencies without providing some sort of service lifetime indicator to log4net. This would then require log4net to create new instances of types when a scoped service has been disposed and the higher level service is to be executed again. This conversation has evolved beyond the scope of this PR. What do you see as the next steps? Thanks! Travis -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
