public static void WriteToLogFile(Exception e) { try { using (var w = File.AppendText(GetLogPath())) { Log(e, w); } } catch (Exception) { //could not log, problems with the log file WriteToConsole("Error while logging, msg: " + e.Message); } }