---
title: Issues with Log4net in Episerver 11
description: Since Episerver was updated to version 11, there has been an issue with Log4net logging on custom classes. This post covers a common way to fix this.
publish date: 2021-01-11
author: Carlos Araujo
image: https://media2.oshyn.com/-/media/Oshyn/Insights/Blog/2021-01-Issues-with-Log4net-in-Episerver-11/blog_hero_log4net-episerver-11.jpg?rev=02f49446c6be4fd1803bddc4080bc5a0
url: http://www.oshyn.com/blog/2021/01/log4net-issues-in-episerver-11
---

# Issues with Log4net in Episerver 11

#### The Issue

Since Episerver was updated to version 11, there has been an issue with Log4net logging on custom classes. Although this has already been reported, there has not been an official patch released in order to fix this issue. However, there is a common way to fix this.

#### The Fix

First, we will need to change the namespace we’re importing and use “EPiServer.Logging.Compatibility” instead of the commonly used “log4net”. After that we will create an instance of the logger like this:

logging instance


The only thing left to do would be to set a route to the log4net configuration file inside the web.config in the <appSettings> section like this:

web.config

```
<add key="log4net.Config" value="EPiServerLog.config"/>
<add key="log4net.Config.Watch" value="True"/>
```

#### References

- Initialization module using log4net directly disables logging [Episerver Developer Community Support]
- Upgrade to CMS 11 - Log4Net stopped working [Episerver Support Center]
- Logging with log4net [Developer Community Documentation]
