Browse Source

Added Comments to AuditLog

pull/395/head
Yunus Emre Kalkan 8 years ago
parent
commit
1aa51d921f
  1. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs
  2. 3
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs
  3. 1
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs

2
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain.Shared/Volo/Abp/AuditLogging/AuditLogConsts.cs

@ -9,5 +9,7 @@
public const int MaxBrowserInfoLength = 512;
public const int MaxExceptionsLength = 4000;
public const int MaxCommentsLength = 256;
}
}

3
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/AuditLog.cs

@ -31,6 +31,8 @@ namespace Volo.Abp.AuditLogging
public virtual string Exceptions { get; protected set; }
public virtual string Comments { get; protected set; }
public virtual Dictionary<string, object> ExtraProperties { get; protected set; }
public virtual ICollection<EntityChange> EntityChanges { get; protected set; }
@ -58,6 +60,7 @@ namespace Volo.Abp.AuditLogging
EntityChanges = auditInfo.EntityChanges.Select(e => new EntityChange(guidGenerator, Id, e)).ToList();
Actions = auditInfo.Actions.Select(e => new AuditLogAction(guidGenerator.Create(), Id, e)).ToList();
Exceptions = auditInfo.Exceptions.JoinAsString(Environment.NewLine);
Comments = auditInfo.Comments.JoinAsString(Environment.NewLine);
}
}
}

1
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/AbpAuditLoggingtDbContextModelBuilderExtensions.cs

@ -28,6 +28,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
b.Property(x => x.ClientName).HasMaxLength(AuditLogConsts.MaxClientNameLength).HasColumnName(nameof(AuditLog.ClientName));
b.Property(x => x.BrowserInfo).HasMaxLength(AuditLogConsts.MaxBrowserInfoLength).HasColumnName(nameof(AuditLog.BrowserInfo));
b.Property(x => x.Exceptions).HasMaxLength(AuditLogConsts.MaxExceptionsLength).HasColumnName(nameof(AuditLog.Exceptions));
b.Property(x => x.Comments).HasMaxLength(AuditLogConsts.MaxCommentsLength).HasColumnName(nameof(AuditLog.Comments));
b.Property(x => x.ExecutionDuration).HasColumnName(nameof(AuditLog.ExecutionDuration));
b.Property(x => x.ImpersonatorTenantId).HasColumnName(nameof(AuditLog.ImpersonatorTenantId));
b.Property(x => x.ImpersonatorUserId).HasColumnName(nameof(AuditLog.ImpersonatorUserId));

Loading…
Cancel
Save