Skip to content

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

@arbokrad

Description

@arbokrad

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?

Metadata

Metadata

Assignees

Labels

Feature: Scenario-Based LoggingItems related to Logger.setScenario(), LoggerScenarioRule__mdt, etc.Layer: Log ManagementItems related to the custom objects & Logger Console appType: BugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions