Log File Question
-
Im a beginner in VB.net. Im was about to create a text log file to record my application activity such as the user update or delete something then such activity will be recorded in text file. I have this code from code project last time:
Private Shared Sub WriteToAppLog( _ ByVal message As String _ , ByVal messageType As EventLogEntryType _ ) Dim elLog As System.Diagnostics.EventLog Try elLog = New System.Diagnostics.EventLog( _ "Application" _ , Environment.MachineName _ , Application.ProductName _ ) elLog.WriteEntry(message, messageType) Catch ex As Exception 'Your error handling here End Try End Sub
But im not really understand how to implement it and where i can check the log file from above code? Does it appear to be .txt file? and does above code have to be placed in every form in my vb.net? If u have any other code than above, feel free to tell me. Please help me, this is my last step of my project. Thanks.