v4.15.9 - Bugfix: Entry Save Override Is Not Always Used #858
jongpie
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks again to @jvega-intakedesk & team for reporting issue #856 (via discussion #855), helping to test PR #857! 🥳
Core Unlocked Package Changes
Quick context on this release: in Apex, developers have the ability to force certain entries to always save, even if the entry's logging level doesn't meet the current user's logging level (e.g., a
DEBUG
entry can be made to always save, even if the user's logging level is set toINFO
). This is useful for a lot of teams in a lot of situations (such as auditing/monitoring requirements), and has been a feature for a loooong time.But, @jvega-intakedesk & team recently pointed out that although the
LogEntryEvent__e
platform events are successfully published, the correspondingLogEntry__c
records are inadvertently not created. This release corrects this issue with a few changes:Added new fields
EntrySaveReason__c
onLogEntryEvent__e
&LogEntry__c
to explicitly track why an entry is saved, with 2 possible values:Logging Level Met
: indicates that the entry was saved because the entry's specified logging level meets the logging user's configured logging level settings, stored inLoggerSettings__c.LoggingLevel__c
.Save Overridden
: indicates that the entry was saved because a developer has overridden in code theshouldSave
flag for the entry. This is done by developers to ensure certain entries are always logged, regardless of the user's configured logging level.Updated
LogEntryEventBuilder
andLogEntryEventHandler
to set the new fields onLogEntryEvent__e
andLogEntry__c
.LogEntryEvent__e
andLogEntry__c
records will now have a value populated inEntrySaveReason__c
.LogEntry__c
records will still havenull
- no changes are being introduced to backfill the data.Updated the logic in
LogEntryEventHandler.filterLogEntryEventsToSave()
to check the value of the new fieldLogEntryEvent__e.EntrySaveReason__c
. Any entries with a save reason ofOverride
are always saved inLogEntry__c
(which is the piece that directly fixes LogEntryEventHandler.filterLogEntryEventsToSave filters out entries that were forcefully saved with Logger.newEntry(String, Boolean) #856).The flexipage
LogEntryRecordPage
has also been updated to display the new fieldLogEntry__c.EntrySaveReason__c
when it's populated. For any existingLogEntry__c
records with anull
value, the flexipage will hide the field.Installation Info
Core
Unlocked Package - no namespacesf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015pGKQAY
This discussion was created from the release Bugfix: Entry Save Override Is Not Always Used.
Beta Was this translation helpful? Give feedback.
All reactions