Пример #1
0
        public static void LogError(string messageException, string source)
        {
            CFNEducation_FormationEntities db = new CFNEducation_FormationEntities();
            Education_Log logInfo             = new Education_Log
            {
                Log_Date    = DateTime.Now,
                Log_Message = messageException,
                Log_Source  = source
            };

            db.Education_Log.Add(logInfo);
            db.SaveChanges();
        }
Пример #2
0
        public static void LogError(Exception ex, string source)
        {
            CFNEducation_FormationEntities db = new CFNEducation_FormationEntities();
            Education_Log logError            = new Education_Log
            {
                Log_Date       = DateTime.Now,
                Log_Message    = ex.Message,
                Log_Stacktrace = ex.StackTrace,
                Log_Source     = source
            };

            db.Education_Log.Add(logError);
            db.SaveChanges();
        }