示例#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 { }
     }
 }