BancoEventErrorLog (nuget): Created a new nuGetPackage for Event Log for logging events to Event Viewer and error Log/send email on exception dll. 1) Creates and saves event Log. 2) Sends email on errors.  Sample event log:  Event log can be written to Windows Event viewer or can also be saved to a text file [managed through settings in config file] ErrorLogHelper.WriteErrorLog("Window service Init");  Sample Error Log during exception: ErrorLogHelper.LogErrorandSendMail("Sample error, also pass the exception that occured", ex)  This above exception can be written to an event log and also send an email by implementing below  ErrorLogHelper.WriteErrorLog(ErrorLogHelper.LogErrorandSendMail("Window service failed to Initialize", ex), System.Diagnostics.EventLogEntryType.Error);  Following are the config settings that need to be set that are specific for the app:  Default implementation is to write it to a text file, but it can write to an event log and send an email by changing the following ConfigurationManager.AppSettings["LogEvent"] ConfigurationManager.AppSettings["SendErrorEmail"]  Event Viewer Name  = ConfigurationManager.AppSettings["EventViewerName"]  text file file path ConfigurationManager.AppSettings["LogFilePath"]  Email From and Display Name ConfigurationManager.AppSettings["EmailDisplayName"].ToString(), ConfigurationManager.AppSettings["EmailAddressFrom"] Email Subject: ConfigurationManager.AppSettings["EmailSubject"] Email To: ConfigurationManager.AppSettings["EmailAddress"]
Keywords: Event|Log|Error|Send|email|on|exception