Integrating Log4net

Topics: Prism v1
Apr 3, 2009 at 8:07 PM
Hi All,

I'm just going through the process of centralising my application logging into a CAL module.

Presently I have a reference to an ILog in my app class and I also have a method on the app class that configures Log4net.  This is executed during the application OnStartup(object sender ...) event handler.  The first actual use of an ILog object is in the bootstrapper and occurs in the GetModuleEnumerator() method on the bootstrapper.  Herein lies the problem!

You can't obtain a reference to an interface through the container at this point due to the type not yet having been registered in the container.  Or is the StartupLoaded=true  enough to get this loaded prior to module enumeration?

I don't really want the spread of Log4net config happening in more than one place really.  Does anyone have any ideas how I could somehow "tap in" to the pre startup stuff?