Created
May 28, 2020 11:23
-
-
Save luisdeol/f22d3625ae40442c04a8aef9c52377b3 to your computer and use it in GitHub Desktop.
3.5: Writing to ETW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
namespace _35_ApplicationDiagnostics | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var source = "35_ApplicationDiagnostics"; | |
using (var eventLog = new EventLog("Aplicativo")) | |
{ | |
if (!EventLog.SourceExists(source)) | |
{ | |
EventLog.CreateEventSource(source, "LogApp"); | |
} | |
eventLog.Source = source; | |
eventLog.EnableRaisingEvents = true; | |
eventLog.EndInit(); | |
eventLog.WriteEntry("Just testing EventDe Log writing.", EventLogEntryType.Information); | |
} | |
Console.Read(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment