In the previous PRISM version, one could create a custom Log4Net adapter class (derived from ILoggerFacade) and override the protected CreateLogger method of the abstract Prism.Bootstrapper class like the following:
protected override ILoggerFacade CreateLogger()
{
return new Log4NetAdapter();
}
In the newer PRISM 7 version, all methods of the Bootstrapper class were moved to the PrismApplicationBase class. However, the virtual CreateLogger method cannot be found anymore.
Question: How can PRISM 7 be configured to use a custom Log4Net adapter?
The
CreateLoggermethod does not exist anymore in Prism 7. You can just register your custom logger asILoggerFacadein the container by overridingRegisterTypesin yourPrismApplication.If you already have created an instance of your logger before, you can register it like this.