Log Batch Purger and scheduler #724
-
Hi Team, I need some help regarding the Nebula Logger's purge functionality and would really appreciate your guidance.
Thanks in advance for your guidance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @nishanth-yb there's some info about this in README, but essentially:
Ultimately, you just need to set the value of In your case, if you want to keep logs for the current month, you could update the value of Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Hey Jonathan,
Makes sense, thank you so much for the clarification.
This helps a lot.
Thanks again,
Nishanth
…On Tue, 30 Jul, 2024, 9:17 pm Jonathan Gillespie, ***@***.***> wrote:
Hi @nishanth-yb <https://github.com/nishanth-yb> there's some info about
this in README
<https://github.com/jongpie/NebulaLogger/tree/v4.13.15#batch-deleting-with-apex-jobs>,
but essentially:
- The date field Log__c.LogRetentionDate__c controls when a Log__c
record is deleted (as well as its related LogEntry__c records).
- LogBatchPurger will delete any records where LogRetentionDate__c
<= System.today()
- To keep a record, you can set LogRetentionDate__c to null
- You can use the custom settings field
LoggerSettings__c.NumberOfDaysToRetainLogs__c to customize (including
per profile or user if you want) the value saved in
Log__c.LogRetentionDate__c.
- By default, LoggerSettings__c.NumberOfDaysToRetainLogs__c is
populated with "TODAY + 14 DAYS" - so by default, all Log__c
records will be kept for 14 days before LogBatchPurger will delete
it
Ultimately, you just need to set the value of Log__c.LogRetentionDate__c
to control when data is deleted (using either LoggerSettings__c, or
building your own automation to set it, or simply manually editing the
field).
In your case, if you want to keep logs for the current month, you could
update the value of LoggerSettings__c.NumberOfDaysToRetainLogs__c from 14
to 30 (using 30 days as approximately 1 month) - any new Log__c records
would then be kept for 30 days before being deleted.
Hope this helps!
—
Reply to this email directly, view it on GitHub
<#724 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6MIKXZOAZVCHTSN7AQ5G5LZO6YRFAVCNFSM6AAAAABLQYWE4OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMJZGI2DENA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi @nishanth-yb there's some info about this in README, but essentially:
Log__c.LogRetentionDate__c
controls when aLog__c
record is deleted (as well as its relatedLogEntry__c
records).LogBatchPurger
will delete any records whereLogRetentionDate__c <= System.today()
LogRetentionDate__c
tonull
LoggerSettings__c.NumberOfDaysToRetainLogs__c
to customize (including per profile or user if you want) the value saved inLog__c.LogRetentionDate__c
.LoggerSettings__c.NumberOfDaysToRetainLogs__c
is populated with "TODAY + 14 DAYS" - so by default, allLog__c
records will be kept for 14 days beforeL…