Skip to content

Some system messages fail when scenario-usage is required in an org #882

@jongpie

Description

@jongpie

Using the LoggerParameter__mdt record RequireScenarioUsage, admins/devs can choose to enforce the usage of logger scenarios in their orgs. This feature was added in release v4.13.3, but it looks like (the whole time??) there are issues with some of the system-generated log entries that are generated async.

In particular, the method Logger.callStatusApi() seems to be the most problematic area right now:

  • This method is called by the inner class LogEntryEventHandler.StatusApiCalloutQueueable.
  • Internally, the method adds some system messages, but doesn't specify a scenario.
  • Since LogEntryEventHandler.StatusApiCalloutQueueable runs async, any in-memory scenario is lost (from the originating transaction). So if no default scenario is configured, a LoggerException is thrown.

Metadata

Metadata

Assignees

Labels

Feature: Scenario-Based LoggingItems related to Logger.setScenario(), LoggerScenarioRule__mdt, etc.Layer: ConfigurationItems related to the custom hierarchy setting LoggerSettings__c or any included custom metadata typeType: BugSomething isn't workingtestsRelates to Apex or LWC jest tests

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions