How can I log Castle Windsor internal logs? For example if I had misconfigured Castle in a way that is failing to load the connection string, I want to know if I can log the errors from Castle when it tries to resolve the connection string. I'm using Log4Net Facility and I'm only able to see application logs, not Windsor logs.
相关问题
- 最新的log4net是不是不支持写入到mysql了。
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
相关文章
- 最新的log4net是不是不支持写入到mysql了。
- how do I log requests and responses for debugging
- How should I configure log4net to write to %LOCALA
- Log4Net Multiple Projects
- Android Studio doesn't display logs by package
- Stacktrace does not print in Glassfish 4.1 Cluster
- Out of curiosity — why don't logging APIs impl
- Laravel log file based on date
Your call to WindsorContainer.Resolve<> will throw an exception if the resolution fails. You should log this exception in your "bootstrapping" code that is responsible for creating the container and resolving the needed component(s). The exception message typically tells you exactly what is wrong in excruciating detail.
To my knowledge, Windsor does not do any "internal" logging via log4net (perhaps one of the contributors can correct/affirm this). If you wish to log "internal" events, you can hook up to the event handlers on the kernel (accessible via WindsorContainer.Kernel). For example, there are ComponentRegistered and DependencyResolving events that allow you to take custom action on registrations and resolutions, respectively.