New Logger Plugin Framework + optional Slack plugin
-
#165 - In previous versions, if you built your own automations on
Log__c
andLogEntry__c
objects, you could experience inconsistent and unexpected results since there were multiple automations running (the automations included in Logger + your own automations). Now, you can create Apex and Flow "plugins" - the logger system will then automatically run the plugins after each trigger event (BEFORE_INSERT, BEFORE_UPDATE, AFTER_INSERT, AFTER_UPDATE, and so on)- Flow plugins: your Flow should be built as auto-launched Flows with these parameters:
Input
parametertriggerOperationType
- The name of the current trigger operation (such as BEFORE_INSERT, BEFORE_UPDATE, etc.)Input
parametertriggerNew
- The list of logger records being processed (Log__c
orLogEntry__c
records)Output
parameterupdatedTriggerNew
- If your Flow makes any updates to the collection of records, you should return a record collection containing the updated recordsInput
parametertriggerOld
- The list of logger records as they exist in the datatabase
- Apex plugins: your Apex class should extend the abstract class
LoggerSObjectHandlerPlugin
. It includes 1 method signature that you must implementpublic override void execute(TriggerOperation triggerOperationType, List<SObject> triggerNew, Map<Id, SObject> triggerNewMap, List<SObject> triggerOld, Map<Id, SObject> triggerOldMap) {}
- Flow plugins: your Flow should be built as auto-launched Flows with these parameters:
Once you've created your Apex and/or Flow plugins, you can configure them using the new CMDT object LoggerSObjectHandlerConfiguration__mdt
. This configuration also provides the ability to enable/disable each of the handler classes (useful for temporarily disabling these classes). See README.md for more details.
Additional Changes
- Bugfix for #155 - logging from
Messaging.InboundEmailHandler
classes should now work successfully - Bugfix for #166 - the
LogBatchPurger
batch class has been optimized by @jamessimone to avoid the error, "Too many DML rows: 10001"