Question:You have been asked to profile a business application that can be accessible using the Event
Log API.
You have started by adding the following code to create a custom event log:
If EventLog.SourceExists("Application1") Then
EventLog.DeleteEventSource("Application1")
End If
'Create new event log
EventLog.CreateEventSource("Application1", "Profile")
You need to write an event to the Application1 event log.
What code must you use? - (VB.Net)
A Dim log As New EventLog()
log.Source = "Application1"
log.Log = "Profile"
log.WriteEvent("Writing to event log.")
B Dim log As New EventLog()
log.Source = "Profile"
log.Log = "Application1"
log.WriteEvent("Writing to event log.")
C Dim log As New EventLog()
log.Source = "Application1"
log.Log = "Profile"
log.WriteEntry("Writing to event log.")
D Dim log As New EventLog()
log.Source = "Profile"
log.Log = "Application1"
log.WriteEntry("Writing to event log.")