Пример #1
0
 public static void Log(Exception exp)
 {
     try
     {
         using (StreamWriter w = File.AppendText(Path.Combine(CommonFunctions.GetLogsFolder(), "ErrorLog.txt")))
         {
             w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp.ToString() + "\r\n=====================================================\r\n");
         }
     }
     catch { }
 }
Пример #2
0
 public static void Log(string exp, string file)
 {
     try
     {
         using (StreamWriter w = File.AppendText(Path.Combine(CommonFunctions.GetLogsFolder(), file)))
         {
             w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp + "\r\n=====================================================\r\n");
         }
     }
     catch { }
 }
Пример #3
0
 public static void Log(string exp, string file)
 {
     try
     {
         using (StreamWriter w = File.AppendText(Path.Combine(CommonFunctions.GetLogsFolder(), file)))
         {
             w.Write(exp);
         }
     }
     catch { }
 }
Пример #4
0
 public static void Log(Exception exp)
 {
     try
     {
         using (StreamWriter w = File.AppendText(Path.Combine(CommonFunctions.GetLogsFolder(), "ErrorLog.txt")))
         {
             //w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp.ToString() + (exp.Data.Contains("Fisier") ? ("\r\nFisier: " + exp.Data["Fisier"].ToString()) : "")   + "\r\n=====================================================\r\n");
             w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp.ToString() + LogWriter.StringFromExceptionData(exp) + "\r\n=====================================================\r\n");
         }
     }
     catch (Exception exp2) {
         try
         {
             using (StreamWriter w = File.AppendText("TmpErrorLog.txt"))
             {
                 w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp.ToString() + "\r\n=====================================================\r\n");
                 w.Write(DateTime.Now.ToString("dd.MM.yyyy HH:mm:ss") + "\r\n" + exp2.ToString() + "\r\n=====================================================\r\n");
             }
         }
         catch { }
     }
 }