Initialization module using log4net directly disables logging

Found in

EPiServer.CMS.Core 11.1.0

Fixed in

EPiServer.Logging.Log4Net 2.2.1


Jan 22, 2018


Jun 27, 2018


CMS Core


Closed, Fixed and tested


  1. Add the following intialization module:

        public class AA : IInitializableModule
            private static readonly log4net.ILog _log = log4net.LogManager.GetLogger("test");
            public void Initialize(InitializationEngine context)
            public void Uninitialize(InitializationEngine context)

EXPECTED: Logging works
ACTUAL: Logging stops working

Note: Sometimes for this bug fix to take affect you have to clear "Temporary ASP.NET Files", ie C:\Windows\Microsoft.Net\Framework64\v4.0.30319\Temporary ASP.NET Files\

WORKAROUND: An easy fix is to use namespace EPiServer.Logging.Compatiblity instead of log4net, to make sure log4net can be safely initialized from CMS instead from a custom initialization module.