Skip to content

LoggerSettings__c hierarchy

LoggerSettings__c is a hierarchy custom setting - values cascade org default -> profile -> user. It’s the primary knob for controlling how Nebula Logger behaves at runtime.

The hierarchy

Salesforce hierarchy custom settings resolve at read time by walking three levels:

  1. If a user-level record exists for the current user, its values win.
  2. Otherwise, if a profile-level record exists for the current user’s profile, its values win.
  3. Otherwise, the org default record’s values win.

Nebula Logger reads the effective record every time it needs a setting - so changes take effect immediately without a code deploy.

Fields you’ll use most

FieldPurpose
IsEnabled__cMaster on/off switch. When false, no entries are added to the buffer.
LoggingLevel__cEffective minimum level. Entries below this level are dropped at the framework level.
DefaultSaveMethod__cDefault value for Logger.saveLog() - EVENT_BUS, QUEUEABLE, REST, or SYNCHRONOUS_DML.
DefaultLogPurgeAction__cWhat the purge batch does when a log ages out. Default Delete.
DefaultNumberOfDaysToRetainLogs__cDays between log insert and eligibility for purging. Null = no automatic purge.

Older docs may reference DefaultLoggingLevel__c. The active field is LoggingLevel__c.

Where to edit

  • Logger Console utility bar - the “Logger Settings” panel edits the effective record for the current user without leaving the console.
  • Setup > Custom Settings > Logger Settings - full org-wide view. Manage user and profile-level records here.
  • Anonymous Apex - insert new LoggerSettings__c(SetupOwnerId = ..., ...). Useful in test setup and deploy scripts.

Common patterns

Environment-aware defaults

Tune the org default record to match the environment:

EnvironmentSuggested LoggingLevel__cReason
ProductionINFO or WARNReduce noise and storage impact while preserving incident signal
UATINFOValidate business flows without excessive detail
QADEBUG or FINESupport defect reproduction and integration testing
Sandbox/DevFINE to FINESTDeep diagnostics during active development

Temporary incident window

Increase verbosity temporarily for a specific user or profile:

  1. Create a user- or profile-level LoggerSettings__c record.
  2. Set LoggingLevel__c to DEBUG or FINE for that scope.
  3. Investigate.
  4. Delete the record when done, so the org default reasserts.

Debug users retain longer, integration users retain shorter

Because retention lives in the same hierarchy, you can tune it per profile:

  • Developer profile: longer DefaultNumberOfDaysToRetainLogs__c so investigation work isn’t lost.
  • Integration user profile: shorter retention so their (much larger) log volume doesn’t dominate storage.

Other profiles inherit from the org default.

Save method

DefaultSaveMethod__c sets the default Logger.saveLog() behavior at the hierarchy level. Values:

ValueUse whenTrade-off
EVENT_BUSGeneral-purpose app logging (default).Depends on platform event capacity.
QUEUEABLEDeferring work to reduce synchronous CPU pressure.Adds async dependency and queueable execution timing.
RESTAvoiding mixed-DML constraints in the current context.Requires callout path and valid session context.
SYNCHRONOUS_DMLImmediate persistence, tolerating rollback risk.Log inserts are rolled back if transaction fails.

Individual calls can override this via Logger.saveLog(SaveMethod.QUEUEABLE).

Where next