-
-
Notifications
You must be signed in to change notification settings - Fork 179
Core Features
TODO
TODO
Nebula Logger supports dynamically tagging/labeling your LogEntry__c
records via Apex, Flow, and custom metadata records in LogEntryTagRule__mdt
. Tags can then be stored using one of the two supported modes (discussed below).
Apex developers can use 2 new methods in LogEntryBuilder
to add tags - LogEntryEventBuilder.addTag(String)
and LogEntryEventBuilder.addTags(List<String>)
.
// 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);
Flow builders can use the Tags
property to specify a comma-separated list of tags to apply to the log entry. This feature is available for all 3 Flow classes: FlowLogEntry
, FlowRecordLogEntry
and FlowCollectionLogEntry
.
Admins can configure tagging rules to append additional tags using the custom metadata type LogEntryTagRule__mdt
.
- Rule-based tags are only added when
LogEntry__c
records are created (not on update). - Rule-based tags are added in addition to any tags that have been added via Apex and/or Flow.
- Each rule is configured to apply tags based on the value of a single field on
LogEntry__c
(e.g.,LogEntry__c.Message__c
). - Each rule can only evaluate 1 field, but multiple rules can evaluate the same field.
- A single rule can apply mulitple tags. When specifying multiple tags, put each tag on a separate line within the Tags field (
LogEntryTagRule__mdt.Tags__c
).
Rules can be set up by configuring a custom metadata record with these fields configured:
- 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. - 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.
Below is an example of what a rule looks like once configured. Based on this rule, any LogEntry__c
records that contain "My Important Text" in the Message__c
field will automatically have 2 tags added - "Really important tag" and "A tag with an emoji, whynot?! 🔥"
Once you've implementing log entry tagging within Apex or Flow, you can choose how the tags are stored within your org. Each mode has its own pros and cons - you can also build your own plugin if you want to leverage your own tagging system (note: plugins are not currently available in the managed package).
Tagging Mode | Logger's Custom Tagging Objects (Default) | Salesforce Topic and TopicAssignment Objects |
---|---|---|
Summary | Stores your tags in custom objects LoggerTag__c and LogEntryTag__c
|
Leverages Salesforce's Chatter Topics functionality to store your tags. This mode is not available in the managed package. |
Data Model |
|
|
Data Visibility |
|
|
Leveraging Data | Since the data is stored in custom objects, you can leverage any platform functionality you want, such as building custom list views, reports & dashboards, enabling Chatter feeds, creating activities/tasks, and so on. | Topics can be used to filter list views, which is a really useful feature. However, using Topics in reports and dashboards is only partially implemented at this time. |
- Assigning Permission Sets to Users
- Configuring Global Feature Flags
- Configuring Profile & User-Specific Settings
- Configuring Data Mask Rules
Manual Instrumentation
- Logging in Apex
- Logging in Flow & Process Builder
- Logging in Lightning Web Components & Aura Components
- Logging in OmniStudio
- Logging in OpenTelemetry (OTEL) REST API
ISVs & Package Dependencies
- Overview
- Optionally Use Nebula Logger (When Available) with
Callable
Interface - Require Nebula Logger with Strongly-Coupled Package Dependency
Troubleshooting
Pub/Sub with Platform Events
Persisted Data with Custom Objects
- Logger Console app
- Assigning & Managing Logs
- Using 'View Related Log Entries' Component on Record Pages
- Deleting Old Logs
Official Plugins