The most robust observability solution for Salesforce experts. Built 100% natively on the platform, and designed to work seamlessly with Apex, Lightning Components, Flow, OmniStudio, and integrations.
Batch class used to delete old logs, based on Log__c.LogRetentionDate__c <= :System.today()
LogBatchPurger()execute(Database.BatchableContext batchableContext, List<Log__c> logRecords) → voidRequired by the Database.Batchable interface, this method executes the logic for purging log records.
| Param | Description |
|---|---|
batchableContext |
- The context of the current batch job. |
logRecords |
- The log records to purge. |
execute(Database.BatchableContext batchableContext, List<SObject> scopeRecords) → voidRequired by the Database.Batchable interface, this method executes the logic for purging log records.
| Param | Description |
|---|---|
batchableContext |
- The context of the current batch job. |
scopeRecords |
- The log records to purge. |
finish(Database.BatchableContext batchableContext) → voidRequired by the Database.Batchable interface. This method runs after all batch jobs are complete. This method writes a status to the Log__c object indicating that the purge has finished.
| Param | Description |
|---|---|
batchableContext |
- The context of the batch jobs |
getDefaultBatchSize() → IntegerReturns the default batch size used when running LogBatchPurger
Type
Integer
Description
The Integer value configured in the custom metadata record LoggerParameter.LogBatchPurgerDefaultBatchSize, or 500 as the default
setChainedBatchSize(Integer chainedBatchSize) → LogBatchPurgerThe LogBatchPurger job is designed to run several instances - typically, it runs on LogEntryTag__c, then LogEntry__c, and finally Log__c. This method provides a way to control the batch size used for the chained instances of LogBachPurger
| Param | Description |
|---|---|
chainedBatchSize |
The batch size to use for any subsequent chained instances of LogBatchPurger |
Type
LogBatchPurger
Description
The same instance of LogBatchPurger, useful for chaining methods
start(Database.BatchableContext batchableContext) → Database.QueryLocatorRequired by the Database.Batchable interface. Collects the records / objects passed in to the batch instance and returns a Databae.QueryLocator reference representing the current iteration.
| Param | Description |
|---|---|
batchableContext |
contains the context of the batch job |
Type
Database.QueryLocator
Description
an instance of the Database.QueryLocator class
| Exception | Description |
|---|---|
NoAccessException |
when there is no delete access to Logs |