Write to the Event Log C#


/ Published in: C#
Save to your folder(s)

Output your errors to the Windows event log. Very effective to output from try catch blocks.


Copy this code and paste it in your HTML
  1. using System.Diagnostics;
  2.  
  3.  
  4. EventLog.WriteEntry("Error Title", exp.Message, System.Diagnostics.EventLogEntryType.Error);

Report this snippet


Comments


You need to login to view comments.