Everyone,
I'm having trouble writing an event to the event log. Here is the
chunk of code I currently have.
-----------------------------------------------------------------------
Private Shared Function WriteErrorToLog (ByVal objError As
System.Text.Str ingBuilder, ByVal strSource As String) As Boolean
Dim objEL As New EventLog
Dim blnreturnvalue As Boolean
Dim Response As System.Web.Http Response
Response = System.Web.Http Context.Current .Response
Try
If objEL.SourceExi sts(strSource) = False Then
objEL.CreateEve ntSource(strSou rce, "Applicatio n")
End If
objEL.Source = strSource
objEL.WriteEntr y(objError.ToSt ring(),
EventLogEntryTy pe.Error)
blnreturnvalue = True
Catch ex As Exception
Response.Write( "MSG: " & ex.Message & "<br>")
Response.Write( "ST: " & ex.StackTrace & "<br>")
blnreturnvalue = False
End Try
Return blnreturnvalue
End Function
-----------------------------------------------------------------------
When I call this function I see the following error ...
MSG: Cannot open log for source {0}. You may not have write access.
I'm at a complete loss as to what's going on?? has writing to the
event log become such a chore now?? this is a little crazy ... I've
been at this for a day or so. I've tried switching the impersonate
setting (right now it's at false), permissions on the ASP.NET account,
the IUSR account etc ... I'm running out of ideas.
Thanks in advance for any assistance !
Scott Vercuski
sv*******@parke r.com