Example #1
0
        public static void WriteErrorLog(Exception e)
        {
            try
            {
                StreamReader reader = new StreamReader(Configurations.GetAbsoluteLogFilePath());
                string       whole  = reader.ReadToEnd();
                reader.Close();

                StreamWriter writer = new StreamWriter(Configurations.GetAbsoluteLogFilePath());
                string       error  = "--- START ON: " + DateTime.UtcNow.ToString() + " ---\r\nMessage: " + e.Message +
                                      "\r\n" + e.StackTrace + "--- END (" + DateTime.UtcNow.ToString() + ") ---\r\n" + whole;
                writer.WriteLine(error);
                writer.Close();
            }
            catch (Exception) { }
        }