Releases: jongpie/NebulaLogger
Approval Results Logging
Thanks goes to @PawelWozniak for suggesting this enhancement (issue #844), and to @TrangOul & @jamessimone for working on the changes!
Core Unlocked Package Changes
-
Added new
setApprovalResult()methods inLogEntryEventBuilderfor logging instances of the standard Apex classesApproval.LockResult,Approval.ProcessResult,Approval.UnlockResult, as well as lists of each class. Developers can use the new method overloads with something like this:SObject someRecord = [SELECT Id FROM Account LIMIT 1]; Approval.LockResult lockResult = Approval.lock(someRecord); // The builder's new method overloads setApprovalResult() can be called to capture approval details Logger.debug('Locked record for approval', someRecord) .setApprovalResult(lockResult); Logger.saveLog();
-
The approval result data is stored in the existing set of
DatabaseResult*fields onLogEntry__clikeLogEntry__c.DatabaseResultType__c, shown below:
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.15.9...v4.15.10
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015pGeQAI - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pGeQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pGeQAI
Bugfix: Entry Save Override Is Not Always Used
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 to INFO). 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 corresponding LogEntry__c records are inadvertently not created. This release corrects this issue with a few changes:
-
Added new fields
EntrySaveReason__conLogEntryEvent__e&LogEntry__cto 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 theshouldSaveflag for the entry. This is done by developers to ensure certain entries are always logged, regardless of the user's configured logging level.
-
Updated
LogEntryEventBuilderandLogEntryEventHandlerto set the new fields onLogEntryEvent__eandLogEntry__c.- ℹ️ Going forward, all new
LogEntryEvent__eandLogEntry__crecords will now have a value populated inEntrySaveReason__c. ⚠️ ExistingLogEntry__crecords will still havenull- no changes are being introduced to backfill the data.
- ℹ️ Going forward, all new
-
Updated the logic in
LogEntryEventHandler.filterLogEntryEventsToSave()to check the value of the new fieldLogEntryEvent__e.EntrySaveReason__c. Any entries with a save reason ofOverrideare always saved inLogEntry__c(which is the piece that directly fixes #856). -
The flexipage
LogEntryRecordPagehas also been updated to display the new fieldLogEntry__c.EntrySaveReason__cwhen it's populated. For any existingLogEntry__crecords with anullvalue, the flexipage will hide the field.
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015pGKQAY - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pGKQAY
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pGKQAY
Custom Index for Log__c.ParentLogTransactionId__c
- Fixes #847 by adding Log__c.ParentLogTransactionId__c custom index
This is a small release that will help unblock our friends at Google. See the prior release for more!
Fix Stacktrace Parsing & Reduce logger.test.js
Thanks again to @jamessimone for working on yet another awesome release! 🥇 (See PR #835)
Core Unlocked Package Changes
- Fixed an issue in
LoggerStackTrace.jsthat would cause an unintended exception when there isn't a valid JavaScript stack trace.- This issue previously could happen when logging within the managed package, as well as in some browser configs that have more restrictive settings enabled.
- Added
@apidecorator to the the functionlogger.setField()so that it can be used when logging in Aura components.- This function was added in release
v4.14.4, but wasn't previously accessible by Aura components.
- This function was added in release
- Closed #780 by cleaning up
logger.test.js, resulting in, 1,400 lines of JavaScript code being removed! 🧹- Over the years, 3 different approaches have been used within Nebula Logger to provide JavaScript logging. The older approaches are considered deprecated, but are still supported - so automated testing is critical to ensuring all approaches still work.
- Previously,
logger.test.jshad test cases duplicated for all 3 approaches, making it a nightmare to maintain. - In this release, @jamessimone streamlined the tests so that the same test cases are now used to validate all 3 approaches.
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015pEnQAI - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pEnQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pEnQAI
OmniStudio Logging Enhancements
Thanks to @jamessimone for several OmniStudio improvements in this release! 🎉 (See PR #835)
Core Unlocked Package Changes
- Closed #814 by adding a new
tryCatchcallable method for OmniStudio withinCallableLogger - Fixed a
System.TypeExceptionissue in OmniStudio when attempting to add tags to a log entry withinCallableLogger - Docs: added some explanatory comments for the OmniStudio-specific code within
CallableLogger
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015pEdQAI - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pEdQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015pEdQAI
Bugfix for AuthSession with Null LoginHistory Exception
Thanks to @camillerev for this release / PR #831!
Core Unlocked Package Changes
- Added safe navigation operator on
LoginHistoryfromAuthSessionrecords to avoid aNullPointerException - Fixed an issue where
Log__c.ImpersonatedBy__cwas not set whenAuthSessiondata is queried async
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015p5jQAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015p5jQAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015p5jQAA
FlowLogger exception message handling
Thanks to @jamessimone for working on this fix, and thanks to @shuylern and @andrewofornikar for reporting the issue & sharing their workarounds!
Core Unlocked Package Changes
- Fixed #827:
FlowLoggernow properly truncates theLogEntryEvent__e.ExceptionMessage__cfield. Previously, long values would have caused an exception & prevented the correspondingLogEntryEvent__efrom being properly published.
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oklQAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oklQAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oklQAA
Improved Testability of Queries
Core Unlocked Package Changes
- Fixed #687: Improved how records are queried & converted to the inner classes in
LoggerSObjectProxy, which are used for dynamically interacting with some standard SObject types that don't exist in all orgs (Network,OmniProcess, etc.)- These changes improve the testability of this part of the code base, resulting in more thorough tests & improved code coverage for the core package
- Fixed #457 and fixed #812: Changed Nebula Logger's behavior during test execution so that the org's actual CMDT records are now loaded & used (e.g., records in
LoggerParameter__mdt). This is controlled internally by Nebula Logger via a new Apex classLoggerConfigurationSelector- This provides admins & developers with the ability to fully test their usage of Nebula Logger, including any customizations that have been made to the included CMDT records
- Internally, Nebula Logger's own tests still only use mock CMDT records - they do not leverage the org's actual CMDT records
- Scope creep: added access for the existing Visualforce page
LogMassDeleteto the permission setsLoggerAdmin,LoggerLogViewer, andLoggerEndUser- This page has been around for ~3 years, but the permission sets didn't explicitly provide access to the page
Async Failure Additions Plugin Changes - v1.0.3
- Updated
LogFinalizerto skip logging the async context when no error has occurred - Corrected some test failures caused by changes in core
v4.15.3(this release), now that the org's actual CMDT records are loaded during tests
Big Object Archiving Plugin Changes - v0.9.1
- Corrected some test failures caused by changes in core
v4.15.3(this release), now that the org's actual CMDT records are loaded during tests
Pipeline Changes
- Updated
package.json+build.ymlto auto-generate apackage.xmlmanifest file for the core package's metadata, stored within the repo atnebula-logger/core.package.xml. Thanks to @Coding-With-The-Force for chatting about this!- Example usage:
sf project deploy start --manifest ./nebula-logger/core.package.xml - This new file is intended to provide an official
package.xmlfile for Nebula Logger to help any teams that meet the 2 criteria below:- Team deploys Nebula Logger's metadata to their orgs (instead of installing the unlocked or managed packages)
- Team leverages
package.xmlmanifest files in their deployment/devops process
- Example usage:
- Changed the pipeline to use the base scratch org for codecov.io integration, since this org will have the lowest code coverage of any of the scratch orgs.
- Previously, the advanced scratch org was used, which will always have the highest code coverage. Knowing the highest coverage is a sort-of useful & fun metric, but knowing the minimum code coverage (via the base scratch org) is a much more important aspect to focus on.
- Added some sample CMDT records to
extra-testsdirectory (used by the pipeline) to help validate that the org's records are correctly returned by the new query selector class - Upgraded several dev dependencies in
package.json/ regeneratedpackage-lock.json
Installation Info
Core Unlocked Package - no namespace
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015ok2QAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ok2QAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ok2QAA
Async Failure Additions Plugin Unlocked Package - no namespace
ℹ️ This release of the plugin requires v4.15.3 of Nebula Logger's core unlocked package (above)
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015ok7QAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ok7QAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ok7QAA
Big Object Archiving Plugin Unlocked Package - no namespace
ℹ️ This release of the plugin requires v4.15.3 of Nebula Logger's core unlocked package (above)
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015okCQAQ - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015okCQAQ
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015okCQAQ
Added support for logging instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>
Thanks to @TrangOul for this release by suggesting issue #804 and implementing it in PR #806! 👏🥳
Core Unlocked Package Changes
This release provides the ability to log instances of Database.EmptyRecycleBinResult and List<Database.EmptyRecycleBinResult>. Support was previously added for logging the Database result classes DeleteResult, LeadConvertResult, MergeResult, SaveResult, UpsertResult and UndeleteResult (for more details see release notes for v4.2.0, v4.3.0, v4.7.4, and v4.10.0). But EmptyRecycleBinResult had been overlooked - and in this release, it's now supported like the other result classes 🎉
-
Add new instance method overloads in
LogEntryEventBuilderforsetDatabaseResult()to support logging instances ofDatabase.EmptyRecycleBinResultandList<Database.EmptyRecycleBinResult>global LogEntryEventBuilder setDatabaseResult(Database.EmptyRecycleBinResult emptyRecycleBinResult); global LogEntryEventBuilder setDatabaseResult(List<Database.EmptyRecycleBinResult> emptyRecycleBinResults);
-
Added new static method overloads in
Loggerto make it easier to log instances ofDatabase.EmptyRecycleBinResultandList<Database.EmptyRecycleBinResult>global static LogEntryEventBuilder error(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder error(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder warn(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder warn(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder info(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder info(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder debug(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder debug(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder fine(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder fine(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder finer(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder finer(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder finest(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder finest(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult); global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, LogMessage logMessage, List<Database.EmptyRecycleBinResult> emptyRecycleBinResults); global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, String message, List<Database.EmptyRecycleBinResult> emptyRecycleBinResults);
- Simplified + improved readability of some older Apex code throughout the codebase by using the safe navigator operator
?.and null coalescing operator??in several places
- Fixed some existing code that caused PMD scan violations in newer versions of PMD/sf code analyzer
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.15.1...v4.15.2
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oifQAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oifQAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oifQAA
System.OrgLimits Optimisations
Thanks to @ngreardSF for this release by reporting issue #801 and fixing it in PR #802! 🥳 🎉
Core Unlocked Package Changes
Improved the internal code used to capture details about org limits
- Updated
LogHandlerclass to cache the Apex call toSystem.OrgLimits.getMap()to reduce CPU usage - Added some comments + updated some existing variable names & class name to include 'serializable' to provide a little more context on why there is a custom class for org limits
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.15.0...v4.15.1
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015ohhQAA - Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ohhQAA
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015ohhQAA


