Set the source name for writing log entries. Private static void WriteEventLogEntry(string message) WriteEventLogEntry("This is an entry in the event log by ") NET class.īelow is an example of how to use this class to write to the log: static void Main(string args) It is actually quite simple – all you have to do is use the. In this short article I am going to show you how to write to the Windows Event Log. However, if your application generates large amounts of logs, I recommend you create your own logging system instead, so as not to over clutter the Windows Event Logs. This makes the administrator’s life easier because he/she does not have to monitor logs stored in multiple directories all over the place. The Windows Event Log is a great place to log your application’s errors or major events because it is easily accessible by administrators since all Windows Event logs can be managed from the same console.
0 Comments
Leave a Reply. |