Posts

Showing posts with the label CompilerServices

Add log4net in .Net Application

log4net library If you are planning to use the log4net library for error/info/warning logging in your .net project then this post will help you in that. This post will give you the step by step process to setup and use the log4net library. I have used a slightly different approach to consume the basic methods of log4net.  Instead of creating a static variable of log4net interface, I created a sealed class and inside that created different methods to log the information. I have used the .net framework 4.5 to take the advantages of CompilerServices. If you don’t know about the CompilerServices refer this link . Furthermore, this article is going to explain you how to log the messages in flat file, database logging and sending the log information via email. Lets get started Step 1 – Prerequisite                 Download the latest version of log4net. Or use the neget manager to add the refere...