Repository navigation
New Method Logger.setAsyncContext()
This release introduces a new method & fields to further help with monitoring & troubleshooting of async jobs, using the platform-provided async context interfaces:
The new features in this release can be used either in place of, or in addition to, Nebula Logger's existing method, Logger.setParentTransactionId(), to help with identifying logs from related asynchronous transactions.
Core Unlocked Package Changes
New Method Logger.setAsyncContext()
- Added new
globalmethodLogger.setAsyncContext(). There are 4 overloads - 1 for each of the platform-provided interfaces:void setAsyncContext(Database.BatchableContext batchableContext) {} void setAsyncContext(System.FinalizerContext finalizerContext) {} void setAsyncContext(System.QueueableContext queueableContext) {} void setAsyncContext(System.SchedulableContext schedulableContext) {}
New Fields on LogEntryEvent__e and Log__c
- Added new fields on
LogEntryEvent__eandLog__cthat are set by usingLogger.setAsyncContext()New Fields Description LogEntryEvent__e.AsyncContextType__candLog__c.AsyncContextType__cThe interface of the platform-provided context. Current values are Database.BatchableContext,System.FinalizerContext,System.QueueableContext, andSystem.SchedulableContext.LogEntryEvent__e.AsyncContextParentJobId__candLog__c.AsyncContextParentJobId__cThe ID of the parent job ( Schema.AsyncApexJob) that initiated the async transaction. Used forDatabase.Batchable,System.FinalizerContext, andSystem.QueueableContext.LogEntryEvent__e.AsyncContextChildJobId__candLog__c.AsyncContextChildJobId__cThe ID of the child job ( Schema.AsyncApexJob) that initiated the async transaction. Used forDatabase.Batchable.LogEntryEvent__e.AsyncContextTriggerId__candLog__c.AsyncContextTriggerId__cThe ID of the cron trigger ( Schema.CronTrigger) that initiated the async transaction. - Updated FlexiPage
LogRecordPageto conditionally show a new page section, "Async Context Details", which also conditionally shows the 4 new fields, shown in the screenshot below (in the red box)

- Updated several async classes (including
LogBatchPurgerandLogBatchPurgeScheduler) to leverage the new methodLogger.setAsyncContext()
Internal Code Cleanup
- Eliminated the helper method
LoggerMockDataCreator.createBatchableContext()- the underlying mock batchable context class, as well as some new similar mocks forFinalizer,Queueable, andSchedulable`, are now public and can be instantiated directly- Having the extra static methods was adding a lot of unnecessary complication & redundant code to expose static methods for each constructor
Pipeline Changes
- Upgraded
sfcli (again) to try to resolve some packaging issues in the pipeline (again) - Updated
build.ymlto outputsf versionto help with troubleshooting any future pipeline issues
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.11.5...v4.11.6
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001HZfGQAW - SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001HZfGQAW - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001HZfGQAW
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001HZfGQAW