C# – log4net:ERROR XmlConfigurator: Failed to find configuration section ‘log4net’ in the application’s .config

clog4net

I have created a separate console application for the logging and then added that single console dll to more than one application for logging. As soon as I run the application, it is logging well but also showing the following error

 log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the <log4net> and <configSections> elements. The configuration section should look like: <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />

log4net:ERROR XmlConfigurator: Failed to find configuration section 'log4net' in the application's .config file. Check your .config file for the and elements. The configuration section should look like:

any idea?

Best Answer

Add

<configuration>
    <configSections>
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
    </configSections>
...

</configuration>

to your app/web.config file