Add more fields to LogScenarioRule__mdt #355
Labels
Feature: Scenario-Based Logging
Items related to Logger.setScenario(), LoggerScenarioRule__mdt, etc.
Layer: Configuration
Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type
Layer: Log Management
Items related to the custom objects & Logger Console app
Layer: Logger Engine
Items related to the core logging engine
tech-debt
Type: Enhancement
New feature or request
Milestone
Currently, the
LogScenarioRule__mdt
object provides some basic controls over Nebula Logger's behavior for a specified scenario. However, it does not have equivalent overrides for every feature currently controlled byLoggerSettings__c
. Using log scenario rules, admins & devs should be able to override none/some/all feature flags that live onLoggerSettings__c
. To support this, these new fields should be added toLogScenarioRule__mdt
. There should also be a way to either expire aLogScenarioRule__mdt
at a specifiedDatetime
, or even better - have it only be active during a specified start & end datetime.Existing Custom Fields
IsEnabled__c
NumberOfDaysToRetainLogs__c
Scenario__c
UserLoggingLevel__c
All Overrides for
LoggerSettings__c
Should Be OptionalAdmins, developers (as well as ISVs) should be able to only specify the fields that they want to override on
LoggerSettings__c
- for a few reasonsLoggerAdmin
permission set can leverage the 'Logger Settings' tab/LWC to fine-tune logging features by creating/updatingLoggerSettings__c
records, instead of having to redeployLogScenarioRule__mdt
records.LoggerSettings__c
is that it's a custom hierarchy setting, allowing admins & developers to configure it at the organization, profile, and user levels. This makes it really easy to customize Nebula Logger differently for differents users - theLogScenarioRule__mdt
custom metadata type does not have this option, so making its override fields optional gives admins & developers a way to still leverage the advantages of a custom hierarchy setting, while being able to override certain Nebula Logger feature flags.LogScenarioRule__mdt
), and new fields are added, and existing records aren't updated to populate the new fields.In order to make
Boolean
field optionals, the only viable option I can think of is to define the fields onLogScenarioRule__mdt
as optional picklists with values of 'true' and 'false', and then parse the strings toBoolean
values. It's... not my favorite, but would provide the desired functionality of "each override should be optional" & the implementation should be easy to implement/maintain.Field Naming Conventions:
Default
Prefix: While theLoggerSettings__c
object uses aDefault
prefix for several fields, such asDefaultNumberOfDaysToRetainLogs__c
andDefaultSaveMethod__c
, the prefix will be ommitted on the equivalent fields onLogScenarioRule__mdt
to help indicate that the values onLogScenarioRule__mdt
will override the defaults specified onLoggerSettings__c
.LoggerSettings__c
andLogScenarioRule__mdt
have fields calledIsEnabled__c
(which both serve functional purposes), soLogScenarioRule__mdt.IsEnabled__c
cannot be mapped toLoggerSettings__c.IsEnabled__c
as an override. In this case, I'll probably use the field nameLogScenarioRule__mdt.IsLoggerEnabled__c
to clarify what the field controls. Other similar situations may come up later as new fields are added over time.New Custom Fields to Prove More Control Of Rules
StartTime__c
- optionalDatetime
field. When not null, the rule should only be used whenIsEnabled__c == true
andSystem.now() >= StartTime__c
EndTime__c
- optionalDatetime
field. When not null, the rule should only be used whenIsEnabled__c == true
andSystem.now() <= EndTime__c
New Custom Fields to Override
LoggerSettings__c
FieldsLogger Engine Layer Overrides
IsAnonymousModeEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsApexSystemDebugLoggingEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsDataMaskingEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsJavaScriptConsoleLoggingEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsLoggerEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsRecordFieldStrippingEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'IsSavingEnabled__c
- this will probably be an optional picklist field with values 'true' and 'false'SaveMethodName__c
UserLoggingLevel__c
(existing field)Log Management Layer Overrides
LogOwner__c
PlatformEventStorageLocationName__c
NumberOfDaysToRetainLogs__c
(existing field)The text was updated successfully, but these errors were encountered: