Base solution for your next web application
Open Closed

Periodic Audit Log Deletion #8754


User avatar
0
-bitman created

Hello ANZ Team,

I would like to understand how to enable this new feature in 8,2?

Please advise. Thank you.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Set Configuration.Auditing.IsEnabled and ExpiredAuditLogDeleterWorker.IsEnabled to true.

    if (Configuration.Auditing.IsEnabled && ExpiredAuditLogDeleterWorker.IsEnabled)
    {
        workManager.Add(IocManager.Resolve<ExpiredAuditLogDeleterWorker>());
    }
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    -bitman created

    Thank you @maliming. Is this something that automatically sets the expiration of the audit logs or is there a configuration that we need to set to tell the system when the logs get expired? How long is the default age when the logs get deleted?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    hi @ramilcatalandomingo

    You can see the source code of ExpiredAuditLogDeleterWorker.

    https://github.com/aspnetzero/aspnet-zero-core/blob/d2abf335efab309cc8f4717e2c27372831662dc5/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Auditing/ExpiredAuditLogDeleterWorker.cs#L18

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    -bitman created

    Thank you @maliming

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    -bitman created

    Hello @maliming,

    Just to be sure I am doing the right thing. Attached are my changes. Please advise.

    Thank you!

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Your code looks fine, you can debug to see if this worker is performing as expected.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ramilcatalandomingo,

    Yes, that's correct :)

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)