Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Writing to windows error log

$
0
0
Further to a previous post, I have now managed to write to the windows error log, however im not getting the information I need to track the error

I am creating a workflow on a develop machine and publishing it to a development crm system on s different machine

When the entry in the log gets generated all I get in the error log is ;

The description for Event ID 1 from source Dynamics cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Licence XXXXXX Serial Number XXXXXX
Import Legacy transactions - Create Transactions An unexpected error occurred.
the message resource is present but the message is not found in the string/message table
My code 
   Public Shared Function WriteToEventLog(strEvent As String, strLicence As String, strFileSerial As String) As Boolean
        Dim eventlog As EventLog
        Dim LogSource As String = "Dynamics"
        Dim LogName As String = "Application"
        Try

            If Not System.Diagnostics.EventLog.SourceExists(LogSource) Then
                System.Diagnostics.EventLog.CreateEventSource(LogSource, LogName)
            End If

            eventlog = New System.Diagnostics.EventLog()
            eventlog.Source = LogSource
            eventlog.WriteEntry("Licence " & strLicence & " Serial Number " & strFileSerial & vbCrLf & strEvent, EventLogEntryType.Warning, 1)


            Return True

        Catch ex As Exception
            Return False
        End Try
        Return False
    End Function

Viewing all articles
Browse latest Browse all 46379

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>