How to log objects (structured data) with log4Net and Windsor Integration
In the past I have use the Log4Net ILog interface and custom database appenders to log objects to a database. This is very useful for capturing contextual information such as the machine name, current user, HTTP request details, etc, when logging 开发者_StackOverflow中文版certain kinds of events.
I am now looking at doing the same sort of thing but using IoC via Castle.Windsor. The problem is that Castle's ILogger abstraction does not support the logging of objects. Since I don't really need the abstraction nor support for other logging frameworks, is there another Log4Net integration facility out there that will support injecting ILog instances, or can I get ILog instances from the Windsor logging facility?
Ultimately, I solved this by implementing my own facility based on the Castle logging facility source code but returning the log4Net specific interface.
精彩评论