Posted By

Verician on 09/26/12


Tagged

event log write


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

imbraz
thastyle
Priestd09
danfinrud55


Write to the Event Log C#


 / Published in: C#
 

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

  1. using System.Diagnostics;
  2.  
  3.  
  4. EventLog.WriteEntry("Error Title", exp.Message, System.Diagnostics.EventLogEntryType.Error);

Report this snippet  

You need to login to post a comment.