I would like to use Common.Logging to remove dependencies on a specific logging framework, but I'm not sure how to wire up the ILog interface using the Castle Windsor IoC container. Is there a way to do this? Thanks!
Do you really want to do both? (Use Common.Logging AND inject it via Castle Windsor IoC?) Using Common.Logging allows your app to NOT have a hard dependency on a specific logging framework (e.g. log4net, NLog, Enterprise Logging). I don't use Castle, but my understanding is that its logging facility has a similar goal. You can configure Castle Windsor to use a specific logging framework (such as log4net or NLog), but your application does not need to be aware of which logging framework is ultimately being used.
Injecting Common.Logging via Castle Windsor seems like wearing a belt AND suspenders to hold your pants up! You would be injecting a logging abstraction via Castle Windsor's own logging abstraction factility!
My guess is that you really want to use one technology or the other (Common.Logging or Castle Windsor's logging facility).
If you really do want to inject Common.Logging via Castle Windsor, you might find this link useful:
Logging with Castle.Facilities.Logging and log4net
Among other things, it describes how to write your own custom Castle Windsor logging facility to be injected by Castle Windsor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With