Home > ASP.net C#, Bugs, tricks > Log4net integration

Log4net integration

Hi folks,
I was integarting log4net library which is amazing for logging in .net Applications.

One issue i run into worth mentioning, I got following error
“log4net:ERROR 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: <section name="log4net""

When I used following declartion , issue resolved:

private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

Regards

Categories: ASP.net C#, Bugs, tricks
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.