NebulaLogger icon indicating copy to clipboard operation
NebulaLogger copied to clipboard

Scenario logging level is not respected when Platform Event Storage Logging Level is null

Open arbokrad opened this issue 2 years ago • 0 comments

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

v4.11

New Bug Summary

Setup Org wide settings:

  • LoggingLevel = ERROR
  • Enabled = true
  • Enable Saving = true
  • Platform Event Storage Location = CUSTOM_OBJECTS
  • Platform Event Storage Logging Level = (not set - i think this matters later)

Scenario rule settings for SCENARIO_A:

  • User Logging Level = INFO
  • Enabled = true
  • Enable Platform Event Storage Override = (not set)
  • Platform Event Storage Location = (not set)
  • Enable Log Retention Policy = true
  • Days to Retain Logs = 90

Code

Logger.setScenario('SCENARIO_A');
Logger.info('any message');
Logger.saveLog();

Expected results

  • A single log and log entry generated, belonging to SCENARIO_A

Actual results

  • Logger finds our rules for SCENARIO_A
  • A LogEntryEvent__c is created (visible from the streaming console)
  • Event handler is reached, and runs the filterLogEntryEventsToSave method
  • Event is filtered out
  • No log/log entry is created

When I change the org wide settings like so:

  • Platform Event Storage Logging Level = INFO

... and re-run the same code snippet, the results are:

  • A single log and log entry generated, belonging to SCENARIO_A

It seems like a bug in how it picks logging level to keep or filter out in filterLogEntryEventsToSave where scenario log level is not respected, but only when the Platform Event Storage Logging Level is null?

arbokrad avatar Aug 16 '23 14:08 arbokrad