NebulaLogger icon indicating copy to clipboard operation
NebulaLogger copied to clipboard

Support managing logger scenario rules via a custom object or setting

Open jongpie opened this issue 10 months ago • 1 comments

Currently, logger scenarios can be used both for tracking, but also to control Nebula Logger's behavior (e.g., for certain scenarios, increase the logging level, etc.). This can give a lot of control in complex orgs/teams where only certain parts of the codebase may want to have increased logging (or other settings overrides).

However, this is all managed through the custom metadata typeLoggerScenarioRule__mdt - this makes it very easy to add the rules to source control & deployments, but limits teams who aren't actual admins in an org (and thus, don't have access to modify custom metadata records). In these situations, teams have to either coordinate with an actual admin in the org, or run a full deployment, just to change a scenario rule.

Either in addition to, or instead of (?), the existing LoggerScenarioRule__mdt, there should also be a custom object (or maaaybe a custom setting) that users with the LoggerAdmin permission set can manage.

  • This would come at the expense of more SOQL queries needed to query the custom object (as well as some data storage), but the overall benefits may be worth it.
  • Platform cache could be used to help minimize the impact of queries, though not all orgs have platform cache allocation for Nebula Logger to use.

jongpie avatar Jan 21 '26 15:01 jongpie

I was thinking about taking a stab at resolving this issue along with #941. This could be achieved with either a custom object or a list custom setting I think. Custom settings avoid the additional SOQL/storage overhead but custom objects would provide a level of report-ability that custom settings will not. As the existing settings are stored in custom settings and CMDT I'm assuming no one has asked for reporting capabilities, so my initial thoughts would be a list custom setting such as LoggerScenarioSettings__c to represent Scenario + SetupOwner rows, where SetupOwner is org/profile/user. The engine would resolve base LoggerSettings__c first, overlay any matching LoggerScenarioRule__mdt deployable default, then overlay active scenario settings in org → profile → user order. This keeps existing CMDT behavior backward compatible, gives LoggerAdmin users runtime management without metadata deployments, and supports the #941 use case of setting LoggingLevel for a specific user within a specific scenario.

Since list custom settings do not provide as nice of a native UX, I’d pair this with a loggerScenarioSettings LWC modeled after the existing loggerSettings component, including picklist-style inputs for enum-like text fields and an effective-settings preview.

Would love any feedback or concerns you have with the approach. Once we agree on a design I can start working on this.

davidwestberry avatar Jun 18 '26 16:06 davidwestberry