SIGN UP MEMBER LOGIN:    
Blog

What is meant by Eventlog in ASP.NET

Posted by Sapna Blogs | ASP.NET using VB.NET Feb 18, 2011
Explains how to log exceptions which occur in ASP.NET web site in the Windows Event Log.

This blog will shows you how to log exceptions that will occur in your ASP.NET web site in the Windows Event Log.

Eventlog Example

<%@ Page %>
<script language="vb" runat="server">
  Sub Page_Load(sender As Object, e As EventArgs)
    Dim a as Integer=0
    Dim myEventLog as System.Diagnostics.EventLog
    Try
      a=1/a
    Catch ex as Exception
      myEventLog=new System.Diagnostics.EventLog()
      myEventLog.Log="Application"
      myEventLog.Source="asp"
      myEventLog.WriteEntry(ex.ToString())
    End Try
  End Sub
</script>
<html>
  <body>
    <form id="form1" method="post" runat="server">
    </form>
  </body>
</html>

Hope this will help you.

share this blog :
post comment