public void SendError(Exception exception) { AuditDBContext.AddSystemLogEntry(this, System.Guid.NewGuid(), LoggedInUser == null ? (long?)null : LoggedInUser.Id, LogEventType.Error, exception.Message, exception.StackTrace, exception.InnerException != null ? exception.InnerException.Message : string.Empty, exception.InnerException != null ? exception.InnerException.StackTrace : string.Empty ); SyslogSender.SendError(this, exception); }
public int DataContextSaveChanges() { try { if (LoggedInUser != null) { return(AuditDBContext.SaveChanges(LoggedInUser)); } else { return(AuditDBContext.SaveChanges()); } } catch (System.Data.Entity.Validation.DbEntityValidationException error) { SendError(error); throw; } catch (System.Data.Entity.Infrastructure.DbUpdateException err) { SendError(err); throw; } }
public void SendWarning(string warningMessage) { AuditDBContext.AddSystemLogEntry(this, System.Guid.NewGuid(), LoggedInUser == null ? (long?)null : LoggedInUser.Id, LogEventType.Warning, warningMessage); SyslogSender.SendWarning(this, warningMessage); }
public void SendInformation(string message) { AuditDBContext.AddSystemLogEntry(this, System.Guid.NewGuid(), LoggedInUser == null ? (long?)null : LoggedInUser.Id, LogEventType.Information, message); SyslogSender.SendInformation(this, message); }