Adding error logging

Log errors with call stacks to the Windows Event Viewer