Tagging System Overhaul
Added new tagging objects & more robust tagging functionality
- 2 "tagging modes" are now built into Nebula Logger
- Using Salesforce Topics: this old functionality is still available in the unlocked package (but still not available in the managed package. However, as of release v4.6.0, it will no longer be the default. After upgrading to v4.6.0, you can revert to using Topics by updating the custom metadata record "LogEntryEventHandler - Use Topics for Tags" within the CMDT object
LoggerSObjectHandlerParameter__mdt
- simply change theValue__c
field fromfalse
totrue
and save. - Using Logger's Custom Tagging objects: available in both the unlocked package and managed package, this mode will be the default as of release v4.6.0. This mode uses 2 additional custom objects,
LoggerTag__c
andLogEntryTag__c
in place ofTopic
andTopicAssignment
(respectively)
- Using Salesforce Topics: this old functionality is still available in the unlocked package (but still not available in the managed package. However, as of release v4.6.0, it will no longer be the default. After upgrading to v4.6.0, you can revert to using Topics by updating the custom metadata record "LogEntryEventHandler - Use Topics for Tags" within the CMDT object
- Tags can be added in 3 different ways
- In Apex: developers can use 2 new methods in
LogEntryBuilder
to add tags// Use addTag(String tagName) for adding 1 tag at a time Logger.debug('my log message').addTag('some tag').addTag('another tag'); // Use addTags(List<String> tagNames) for adding a list of tags in 1 method call List<String> myTags = new List<String>{'some tag', 'another tag'}; Logger.debug('my log message').addTags(myTags);
- In Flow: flow builders can set the property
List<String> tags
within the Flow classesFlowLogEntry
,FlowRecordLogEntry
andFlowCollectionLogEntry
- Using the custom metadata type object
LogEntryTagRule__mdt
: admins can configure tagging rules to append additional tags. These tags are added on top of any tags added via Apex and/or Flow. Rules can be set up by configuring a rule with these fields set:- Logger SObject: currently, only the "Log Entry" object (
LogEntry__c
) is supported. - Field: the SObject's field that should be evaluated - for example,
LogEntry__c.Message__c
. Only 1 field can be selected per rule, but multiple rules can use the same field. - Comparison Type: the type of operation you want to use to compare the field's value. Currently supported options are:
CONTAINS
,EQUALS
,MATCHES_REGEX
, andSTARTS_WITH
- Comparison Value: the comparison value that should be used for the selected field operation
- Tags: a list of tag names that should be dynamically applied to any matching
LogEntry__c
records. When specifying multiple tags, put each tag on a separate line within the Tags field - Is Enabled: only enabled rules are used by Logger - this is a handy way to easily enable/disable a particular rule without having to entirely delete it
- Logger SObject: currently, only the "Log Entry" object (
- In Apex: developers can use 2 new methods in