tags:

views:

41

answers:

0

I've got the code below up and running. It captures the user name and the browser that was used to access an intranet site. How can I modify the code so that ELMAH logs a specific StatusCode to the ELMAH_Error table in SQLServer? The eventual goal is the ability to extract out of the log these specific log entries to identify which PC's need to be upgraded.

    Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
    ' Code that runs when a new session is started'

    Dim ExceptionMessage As New StringBuilder
    ExceptionMessage.Append(System.Security.Principal.WindowsIdentity.GetCurrent.Name + " accessed the site using " + Request.Browser.Browser + " " + Request.Browser.MajorVersion.toString + "." + Request.Browser.MinorVersion.tostring)
    Dim NewException As New NotSupportedException(ExceptionMessage.ToString)
    Elmah.ErrorSignal.FromCurrentContext().Raise(NewException)

End Sub