private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var exception = e.ExceptionObject as Exception;
if (exception != null)
{
while (exception.InnerException != null) exception = exception.InnerException;
Logger.FATAL(exception.ToString());
}
else
Logger.FATAL(e.ToString());
}