The Temple of Fu

code, systems and games

ASP.NET – Write to Windows Event Log

leave a comment »

Ever have a need to write to the Windows Event log, in my case it was to get around debugger anomalies.

public partial class EventWireupPage : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("ASPNET", "Page_Load");
}

protected void GridView1_RowCommand(object sender,GridViewCommandEventArgs e)
{
System.Diagnostics.EventLog.WriteEntry("ASPNET","GridView1_RowCommand");
}

}

Advertisements

Written by lordfu

March 20, 2010 at 2:42 pm

Posted in Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: