Search code examples
asp.netaspnetboilerplate

What is the proper way to alter column parameters in AbpAuditLog?


How can I alter column parameters in abpAuditLogs table? I want to alter it to nvarchar(max)


Solution

  • you can increase the size of AuditLog fields like this;

    In DbContext class:

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        AuditLog.MaxParametersLength = 4000;
        //other fields...
    
        base.OnModelCreating(modelBuilder);
    
        //...
    }
    

    You can customize these fields;

    MaxServiceNameLength, MaxMethodNameLength, MaxParametersLength, MaxClientIpAddressLength, MaxClientNameLength, MaxBrowserInfoLength, MaxExceptionLength, MaxCustomDataLength