Click here to Skip to main content
15,894,825 members
Articles / Web Development / ASP.NET

How to Capture Web Events in log4net

Rate me:
Please Sign up or sign in to vote.
4.76/5 (11 votes)
20 Dec 2006CPOL3 min read 55.2K   530   46  
Details how to capture the web events exposed by the ASP.NET framework through log4net. Also provides the details of how to create custom web events that can provide custom logging behavior.
// This software is provided "AS IS" with no warranties of any kind.
// The entire risk arising out of the use or performance of the software
// and source code is with you.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace HealthMonitoring
{
	/// <summary>
	/// Defines the possible log4net logging levels
	/// </summary>
	public enum Level
	{
		Default,
		Debug,
		Info,
		Warn,
		Error,
		Fatal
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
.NET Software Developer

Education
- Working towards M.S. Computer Science
- B.S. Computer Science
- B.S. Computer Information Systems
- Minor Mathematics

Professional
- Microsoft Certified Application Developer
- Microsoft Certified Professional
- C# ASP.NET Developer (4 years)

Other Interests
- Flash Remoting
- Video Encoding (Windows Media and Flash Video)
- Microsoft Content Management Server

More Programming Thoughts and Tips
- http://gabewishnie.blogspot.com

Comments and Discussions