NebulaLogger
NebulaLogger copied to clipboard
Make the default logging level in production orgs be a more sensible default
Currently, LoggerSettings__c.LoggingLevel__c
defaults to 'DEBUG', which makes sense for sandboxes, scratch orgs & dev orgs. But for a few years now, I've been recommending that either 'INFO' or 'WARN' as the value in production orgs for day-to-day monitoring purposes - so Nebula Logger should just... do this automatically.
Right now, the default value for LoggerSettings__c.LoggingLevel__c
is configured directly on the field itself, and I don't think there's a way to make the formula smart enough to know if the current org is prod vs not-prod. To get around this, Logger.getUserSettings() and
LoggerSettingsController` should be updated so that the default value is dynamically set based on the current org type.
Possible considerations:
- [ ] What should drive the org type?
Organization.IsSandbox
? - [ ] Should the org-aware default be hardcoded in code? Or configurable via
LoggerParameter__mdt
records? For example, there could be a CMDT record forProductionLoggingLevel
+ record forSandboxLoggingLevel
--> Apex code determines org type & reads corresponding CMDT record - [ ] Should any other fields on
LoggerSettings__c
be based on the org type?