Hi all I know how to quick and easy way to build the Log4Net in my ASP.NET MVC project [Reference],however how to do it in pure \" Web Form \" project, please help me to sol
4 steps to handle this issue for web form
Step 1:
Using Nuget to get the Log4Net
Step 2:
In Global please put this sentence "log4net.Config.XmlConfigurator.Configure();" in the Application_Start
Step 3: In the Web.Config please write down as following code in the web.config
Final step:
Putting as following code in one page where you want to record the log
private static log4net.ILog Log { get; set; }= log4net.LogManager.GetLogger(typeof(_03_account));
protected void Page_Load(object sender, EventArgs e)
{
Log.Debug("Debug message");
//log.Warn("Warn message");
//log.Error("Error message");
//log.Fatal("Fatal message");
}