Merge pull request #892 from abpframework/issue-891

Add TenantName to Audit logs
pull/947/head
Halil İbrahim Kalkan 6 years ago committed by GitHub
commit cbe45f1a2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,7 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Auditing
{
[Serializable]
public class AuditLogActionInfo : IMultiTenant, IHasExtraProperties
{
public Guid? TenantId { get; set; }

@ -7,7 +7,7 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Auditing
{
//TODO: Make serializable!
[Serializable]
public class AuditLogInfo : IMultiTenant, IHasExtraProperties
{
public string ApplicationName { get; set; }
@ -18,6 +18,8 @@ namespace Volo.Abp.Auditing
public Guid? TenantId { get; set; }
public string TenantName { get; set; }
public Guid? ImpersonatorUserId { get; set; }
public Guid? ImpersonatorTenantId { get; set; }

@ -92,6 +92,7 @@ namespace Volo.Abp.Auditing
{
ApplicationName = Options.ApplicationName,
TenantId = CurrentTenant.Id,
TenantName = CurrentTenant.
UserId = CurrentUser.Id,
UserName = CurrentUser.UserName,
ClientId = CurrentClient.Id,

@ -6,6 +6,7 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Auditing
{
[Serializable]
public class EntityChangeInfo : IMultiTenant, IHasExtraProperties
{
public DateTime ChangeTime { get; set; }

@ -3,6 +3,7 @@ using Volo.Abp.MultiTenancy;
namespace Volo.Abp.Auditing
{
[Serializable]
public class EntityPropertyChangeInfo : IMultiTenant
{
/// <summary>

@ -23,5 +23,7 @@
public const int MaxHttpMethodLength = 16;
public const int MaxUserNameLength = 256;
public const int MaxTenantNameLength = 64;
}
}

@ -19,6 +19,8 @@ namespace Volo.Abp.AuditLogging
public virtual Guid? TenantId { get; protected set; }
public virtual string TenantName { get; protected set; }
public virtual Guid? ImpersonatorUserId { get; protected set; }
public virtual Guid? ImpersonatorTenantId { get; protected set; }
@ -31,9 +33,9 @@ namespace Volo.Abp.AuditLogging
public virtual string ClientName { get; protected set; }
public string ClientId { get; set; }
public virtual string ClientId { get; set; }
public string CorrelationId { get; set; }
public virtual string CorrelationId { get; set; }
public virtual string BrowserInfo { get; protected set; }
@ -59,8 +61,9 @@ namespace Volo.Abp.AuditLogging
public AuditLog(IGuidGenerator guidGenerator, AuditLogInfo auditInfo)
{
Id = guidGenerator.Create();
ApplicationName = auditInfo.ApplicationName;
ApplicationName = auditInfo.ApplicationName.Truncate(AuditLogConsts.MaxApplicationNameLength);
TenantId = auditInfo.TenantId;
TenantName = auditInfo.TenantName.Truncate(AuditLogConsts.MaxTenantNameLength);
UserId = auditInfo.UserId;
UserName = auditInfo.UserName.Truncate(AuditLogConsts.MaxUserNameLength);
ExecutionTime = auditInfo.ExecutionTime;

Loading…
Cancel
Save