Added More Fields on LogEntryEvent__e, Log__c, and LogEntry__c
This release is focused on automatically capturing & storing some new data points (in a few different areas) that provide additional context for monitoring & reporting.
Core Unlocked Package Changes
Logging in Lightning Components: New "Browser Details" fields on LogEntry__c
-
Resolved #225 by updating the
logger
LWC (logEntryBuilder.js
mostly) to capture details about the user's browser & screen. These details are automatically now stored in these new fields onLogEntryEvent__e
andLogEntry__c
:New Fields Source of Data LogEntryEvent__e.BrowserFormFactor__c
andLogEntry__c.BrowserFormFactor__c
The value of FORM_FACTOR
, imported usingimport FORM_FACTOR from '@salesforce/client/formFactor';
LogEntryEvent__e.BrowserLanguage__c
andLogEntry__c.BrowserLanguage__c
The value of window.navigator.language
LogEntryEvent__e.BrowserScreenResolution__c
andLogEntry__c.BrowserScreenResolution__c
The value of window.screen.availWidth + ' x ' + window.screen.availHeight
LogEntryEvent__e.BrowserUrl__c
andLogEntry__c.BrowserUrl__c
The value of window.location.href
LogEntryEvent__e.BrowserUserAgent__c
andLogEntry__c.BrowserUserAgent__c
The value of window.navigator.userAgent
LogEntryEvent__e.BrowserWindowResolution__c
andLogEntry__c.BrowserWindowResolution__c
The value of window.innerWidth + ' x ' + window.innerHeight
Logging in Flow: New Flow Metadata fields on LogEntry__c
-
Resolved #451 by capturing some additional details about the running Flow via the object
FlowDefinitionView
. These details are automatically now stored in these new fields:New Fields Source of Data LogEntry__c.FlowRecordTriggerType__c
The value of FlowDefinitionView.RecordTriggerType
LogEntry__c.FlowTriggerOrder__c
The value of FlowDefinitionView.TriggerOrder
LogEntry__c.FlowTriggerSObjectType__c
The value of FlowDefinitionView.TriggerObjectOrEvent.QualifiedApiName
Organization Details: New & Deprecated fields on LogEntryEvent__e
and Log__c
-
"Renamed" (by creating new fields) some fields on
LogEntryEvent__e
andLog__c
to have a more consistent naming convention. Note that the old fields are still included in the core package and are still populated so that orgs have time to update any existing reporting, etc. Eventually, the old fields will be fully removed from the package.Field Change Source of Data Deprecated Log__c.ApiReleaseNumber__c
and replaced it withLog__c.OrganizationReleaseNumber__c
Retrieved via the optional callout to https://api.status.salesforce.com
Deprecated Log__c.ApiReleaseVersion__c
and replaced it withLog__c.OrganizationReleaseVersion__c
Retrieved via the optional callout to https://api.status.salesforce.com
Deprecated LogEntryEvent__e.ApiVersion__c
andLog__c.ApiVersion__c
and replaced them withLogEntryEvent__e.OrganizationApiVersion__c
andLog__c.OrganizationApiVersion__c
The value of Logger.getOrganizationVersion()
Added new field Log__c.OrganizationLocation__c
Retrieved via the optional callout to https://api.status.salesforce.com
Logger Engine Changes
-
Made some internal changes to the
logger
LWC so that the JavaScript code's approach more closely aligns with the Apex code's approach. This should not have any functional changes (hopefully 😅), this is just to try to provide a little more consistency within the codebase for approaching the same goal (logging) in 2 different languages (Apex & JavaScript).Item In Apex In JavaScript Object used to store in-memory logging data LogEntryEvent__e
objectComponentLogEntry
inner class inlogEntryBuilder.js
Internal method used to access/update in-memory logging data Instance method LogEntryEventBuilder.getLogEntryEvent()
Instance method LogEntryEventBuilder.getComponentLogEntry()
inlogEntryBuilder.js
Bugfixes
- Small bugfix for logging in Flow: Added an extra guard clause in the private instance method
LogEntryHandler.setFlowDefinitionFields()
to prevent a possibleNullPointerException
. Previously, the code assumed that whenOriginLocation__c == 'Flow'
, thenOriginLocation__c
would be the API name of the logging Flow. However, this may not always be the case, especially since the invocable actions currently rely on admins/devs to provide the Flow's API name, which is inherently an imperfect approach - but there isn't currently a way in Apex or Flow to automatically determine the Flow's API name, so the new guard clause helps avoid an exception.
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.10.5...v4.10.6
- SFDX CLI:
sfdx package install --wait 20 --security-type AdminsOnly --package 04t5Y0000023SCqQAM
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000023SCqQAM
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000023SCqQAM