Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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;
     }
 }
Ejemplo n.º 3
0
 public void SendWarning(string warningMessage)
 {
     AuditDBContext.AddSystemLogEntry(this, System.Guid.NewGuid(), LoggedInUser == null ? (long?)null : LoggedInUser.Id, LogEventType.Warning, warningMessage);
     SyslogSender.SendWarning(this, warningMessage);
 }
Ejemplo n.º 4
0
 public void SendInformation(string message)
 {
     AuditDBContext.AddSystemLogEntry(this, System.Guid.NewGuid(), LoggedInUser == null ? (long?)null : LoggedInUser.Id, LogEventType.Information, message);
     SyslogSender.SendInformation(this, message);
 }