Unhandled exceptions not logged by EPiServer.Logging.Log4Net

Found in

EPiServer.CMS.Core 11.1.0

Fixed in

EPiServer.CMS.Core 11.9.1

Created

Jun 13, 2018

Updated

Jun 21, 2018

Area

CMS Core

State

Closed, Fixed and tested


Description

Unhandled exceptions thrown by the application are no longer logged by log4net in the latest version of EPiServer.Logging.Log4Net 2.2.2

Steps to reproduce

  1. Create an Alloy demo website in latest version of CMS and EPiServer.Logging.Log4Net 2.2.2
  2. Write the below code in the index method of the StartPageController.cs file.

       LogManager.GetLogger(typeof(StartPageController)).Error("This is logged");
       throw new Exception("This is not logged");
    

  3. Run the application.
  4. Click the start page.
  5. Application shows an unhandled exception.
  6. Open the application log file.

Expected:
Error and unhandled exception are logged in the log file.

Actual:
Only the error message "This is logged" is logged in log file, not the unhandled exception.

According to customer this works as expected in EPiServer.CMS 9.12.2 together with EPiServer.Logging.Log4Net 2.0.0, but fails in EPiServer.CMS 11.3.4 together with EPiServer.Logging.Log4Net 2.2.2.