static void ThreadException(object sender, ThreadExceptionEventArgs e) { LogException(e.Exception); }