Upgrade to CMS 11 - Log4Net stopped working

  • Updated

A partner upgraded their CMS project to 11 and log4net stopped working. No log is written, no matter what settings set in the EpiserverLog.config. It worked in CMS10.

According to debug logging in log4net it seems that their project is using log4net before Epi so gets triggered from wrong assembly.
So changing:
using log4net;
to:
using EPiServer.Logging.Compatibility;
in this project fixes the problem.

The problem is that this module accesses log4net.LogManager before Epi and trigger autosetup of log4net to the wrong config, need to find a way to make sure EPiServer.Logging.Log4Net can init before initialization modules so we reported a bug also https://world.episerver.com/support/Bug-list/bug/CMS-9555