static void Application_ApplicationExit(object sender, EventArgs e) { //Wait untill all log entries are written. Loggers.Flush(); }