Esempio n. 1
0
 public static void AddExceptionToDbAndTxt(string source, string description, string detail, LogFrom?logFrom = null)
 {
     AddExceptions(new Exceptions()
     {
         DateTime    = DateTime.Now,
         Description = description,
         Source      = source,
         Detail      = detail,
         Track       = string.Empty,
         Server      = Common.Utilities.AddressLoader.GetServerIp(),
         LogFrom     = logFrom.HasValue ? logFrom.Value : OperateLogServices.GeLogFrom()
     });
     TxtLogServices.WriteTxtLogEx(source, "description:{0},detail:{1}", description, detail);
 }
Esempio n. 2
0
 public static void AddExceptions(Exceptions item)
 {
     try
     {
         item.Track       = SubString(item.Track, 2000);
         item.Source      = SubString(item.Source, 100);
         item.Description = SubString(item.Description, 400);
         item.Detail      = SubString(item.Detail, 1000);
         item.DateTime    = DateTime.Now;
         IExceptions factory = ExceptionsFactory.GetFactory();
         factory.AddExceptions(item);
     }
     catch (Exception ex)
     {
         TxtLogServices.WriteTxtLogEx("AddExceptionsLogError", ex);
     }
 }
Esempio n. 3
0
 public static void AddExceptionToDbAndTxt(string fileName, string description, Exception ex, LogFrom?logFrom = null)
 {
     AddExceptions(ex, description, logFrom);
     TxtLogServices.WriteTxtLogEx(fileName, description, ex);
 }