Example #1
0
        void IErrorLogger.Log(Exception exception)
        {
            try
            {
                var logEntry = new LogEntry
                                   {
                                       Date = DateTime.Now,
                                       Message = exception.Message,
                                       StackTrace = exception.StackTrace,
                                   };

                using (var datacontext = new LogDBDataContext())
                {
                    datacontext.LogEntries.InsertOnSubmit(logEntry);
                    datacontext.SubmitChanges();
                }
            }
            catch (Exception)
            {
                // failed to record exception
            }
        }
Example #2
0
 partial void UpdateLogEntry(LogEntry instance);
Example #3
0
 partial void DeleteLogEntry(LogEntry instance);
Example #4
0
 partial void InsertLogEntry(LogEntry instance);