private static string GetSerializedValue(ExceptionLog exceptionLog)
 {
     try
     {
         return new JavaScriptSerializer().Serialize(exceptionLog);
     }
     catch (Exception)
     {
         return string.Format(ResSharedRep.ERROR_RECURSION, "GetSerializedValue");
     }
 }
        public static void LogError(Exception ex, params object[] arrVal)
        {
            try
            {
                var username = GetUser();
                var modelExcep = new ExceptionLog
                {
                    MsgException = ex.Message,
                    ExceptionLogUid = Guid.NewGuid(),
                    InnerException = GetInnerExceptions(ex),
                    ParamsValues = GetSerializedValues(arrVal),
                    StackTrace = ex.StackTrace,
                    Timestamp = DateTime.Now,
                    Username = username
                };

                SaveLogToDb(modelExcep);
            }
            catch (Exception)
            {
                return;
            }
        }
 private static void SaveLogToDb(ExceptionLog modelExcep)
 {
     try
     {
         using (var dbConn = new SignageLogEntities())
         {
             dbConn.ExceptionLog.Add(modelExcep);
             dbConn.SaveChanges();
         }
     }
     catch (Exception)
     {
         SaveLogToFile(modelExcep);
     }
 }
 private static void SaveLogToFile(ExceptionLog exceptionLog)
 {
     try
     {
         LogManager.GetLogger("ERROR_LOGGER").Fatal(GetSerializedValue(exceptionLog));
     }
     catch (Exception)
     {
         return;
     }
 }