Releases: jongpie/NebulaLogger
Added RestRequest and RestResponse Logging
Thanks to @diegocomi for suggesting this enhancement!
Core Unlocked Package Changes
Added logging support for instances of RestRequest
and RestResponse
-
Resolved #514 (suggested by @diegocomi) in PR #613 by introducing new features & fields to support logging instances of
System.RestRequest
andSystem.RestResponse
that are used for Apex REST services:-
Added 2 new
global
instance methods inLogEntryBuilder
to provide a way to log instances ofSystem.RestRequest
andSystem.RestResponse
:global LogEntryEventBuilder setRestRequestDetails(System.RestRequest request);
global LogEntryEventBuilder setRestResponseDetails(System.RestResponse response);
-
Added 2 new
LoggerParameter__mdt
records to control logging of request & response headers when using the new builder methods. TheseLoggerParameter__mdt
records are equivalent to the recordStoreHttpResponseHeaderValues
(introduced in Nebula Loggerv4.11.8
) forSystem.HttpResponse
logging:StoreRestRequestHeaderValues
- this metadata records controls if the request's header values are stored in new fieldsLogEntryEvent__e.RestRequestHeaders__c
andLogEntryEvent__e.RestrequestHeaders__c
. By default, it's enabled.StoreRestResponseHeaderValues
- this metadata records controls if the response's header values are stored in new fieldsLogEntryEvent__e.RestResponseHeaders__c
andLogEntryEvent__e.RestResponseHeaders__c
. By default, it's enabled.
-
Added 9 new fields for
System.RestRequest
data onLogEntryEvent__e
platform eventLogEntryEvent__e.RestRequestBodyMasked__c
LogEntryEvent__e.RestRequestBody__c
LogEntryEvent__e.RestRequestHeaderKeys__c
LogEntryEvent__e.RestRequestHeaders__c
LogEntryEvent__e.RestRequestMethod__c
LogEntryEvent__e.RestRequestParameters__c
LogEntryEvent__e.RestRequestRemoteAddress__c
LogEntryEvent__e.RestRequestResourcePath__c
LogEntryEvent__e.RestRequestUri__c
-
Added 5 new fields for
System.RestResponse
data onLogEntryEvent__e
platform eventLogEntryEvent__e.RestResponseBodyMasked__c
LogEntryEvent__e.RestResponseBody__c
LogEntryEvent__e.RestResponseHeaderKeys__c
LogEntryEvent__e.RestResponseHeaders__c
LogEntryEvent__e.RestResponseStatusCode__c
-
Added 12 new fields for
System.RestResponse
data onLogEntry__c
custom objectLogEntry__c.HasRestRequestBody__c
LogEntry__c.HasRestRequestHeaderKeys__c
LogEntry__c.HasRestRequestHeaders__c
LogEntry__c.RestRequestBody__c
LogEntry__c.RestRequestBodyMasked__c
LogEntry__c.RestRequestHeaderKeys__c
LogEntry__c.RestRequestHeaders__c
LogEntry__c.RestRequestMethod__c
LogEntry__c.RestRequestParameters__c
LogEntry__c.RestRequestRemoteAddress__c
LogEntry__c.RestRequestResourcePath__c
LogEntry__c.RestRequestUri__c
-
Added 8 new fields for
System.RestResponse
data onLogEntry__c
custom objectLogEntry__c.HasRestResponseBody__c
LogEntry__c.HasRestResponseHeaderKeys__c
LogEntry__c.HasRestResponseHeaders__c
LogEntry__c.RestResponseBodyMasked__c
LogEntry__c.RestResponseBody__c
LogEntry__c.RestResponseHeaderKeys__c
LogEntry__c.RestResponseHeaders__c
LogEntry__c.RestResponseStatusCode__c
-
Updated permission sets
LoggerAdmin
,LoggerLogViewer
, andLoggerEndUser
to add access to the new custom fields onLogEntry__c
-
Add 2 new sections on
LogEntryRecordPage
flexipage (shown in the screenshot below)Apex REST Service Request
section shows the corresponding fields forRestRequest
data (when populated)Apex REST Service Response
section shows the corresponding fields forRestResponse
data (when populated)
-
Renamed 2 existing sections on
LogEntryRecordPage
flexipage to help avoid confusion with the 2 new sectionsApex Rest Service Request
andApex REST Service Response
HTTP Request
is nowHTTP Callout Request
HTTP Response
is nowHTTP Callout Response
-
Reduced the Max Length of Several Existing Long Textarea Fields
As Nebula Logger's data model continues to grow, the per-object limit for long textarea fields becomes increasingly important to consider. To compensate for this limit, and to better reflect the amount of data typically stored in these fields, several older fields have been updated to reduce their max length:
LogEntryEvent__e.ExceptionMessage__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.ExceptionStackTrace__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.StackTrace__c
: 131,072 limit reduced to 5,000LogEntryEvent__e.Topics__c
(deprecated/no longer used): 131,072 limit reduced to 256LogEntry__c.ExceptionMessage__c
: 131,072 limit reduced to 5,000LogEntry__c.ExceptionStackTrace__c
: 131,072 limit reduced to 5,000LogEntry__c.FlowDescription__c
: 131,072 limit reduced to 5,000LogEntry__c.StackTrace__c
: 131,072 limit reduced to 5,000
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.8...v4.12.9
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk7BQAS
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk7BQAS
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk7BQAS
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk7BQAS
Bugfix: Improved Conditional Visibility for 'HTTP Response' Page Section
Core Unlocked Package Changes
Improved conditional visibility for 'HTTP Response' page section
-
Fixed #616 (originally discussed in #586) by updating the conditional visibility rules on the flexipage
LogEntryRecordPage
. Now, the 'HTTP Response' section will show up if any of these 3 conditions aretrue
:HttpResponseStatus__c != null
(existing check)HasHttpResponseBody__c == true
HasHttpResponseHeaderKeys__c == true
-
Fixed some test failures in
ComponentLogger_Tests
that occurred when running in a namespaced context -
Added the new-ish Analytics standard tab to the navigation items in the LoggerConsole app. This tab is generally available (GA) as of Salesforce's Summer '23 release.
Pipeline Changes
- Upgraded most of the
devDependencies
inpackage.json
, including thesf
cli - Hopefully fixed package generation for the managed package by including an empty copy of
Admin.profile-meta.xml
ಥ_ಥ - Updated both
sfdx-project.json
files (1 for the unlocked package & 1 for the managed package) to use the new flag"scopeProfiles": true
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.7...v4.12.8
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk6cQAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk6cQAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk6cQAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk6cQAC
Bugfix for Broken LWC Stack Trace Parsing
Core Unlocked Package Changes
Fixed Stack Trace Parsing for Lightning Web Components (LWCs)
- Fixed #346 again (previously fixed in
v4.8.0
) and partially fixed #615 by updatingComponentLogger.cls
so it handles recent-ish changes to the format of stack traces in LWCs.- Previously, this bug would have resulted in fields like
LogEntry__c.OriginLocation__c
andLogEntry__c.StackTrace__c
being incorrectly set tonull
for log entries generated via LWCs using thelogger
LWC. - Also updated
ComponentLogger_Tests
to validate that the logic inComponentLogger
handles different variations of LWC stack traces, so hopefully there aren't future regression issues with this functionality
- Previously, this bug would have resulted in fields like
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.6...v4.12.7
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk21QAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk21QAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk21QAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk21QAC
Bugfix: Added automatic string truncation for LogEntryEvent__e fields
Thanks to @TrangOul, @BastienRaoul, and @Damecek for reporting these issues!
Core Unlocked Package Changes
Automatic String Field Truncation for LogEntryEvent__e
Platform Event Records
- Fixed #589 (reported by @BastienRaoul) and fixed #592 (reported by @Damecek) by updating
LoggerDataStore.EventBus
to support usingDatabase.DmlOptions
for enabling automatic field truncation on platform events, using some custom truncation logic (platform events do not normally support usingDatabase.DmlOptions
).Logger
now passes an instance ofDatabase.DmlOptions
withAllowFieldTruncation == true
when publishingLogEntryEvent__e
records
Data Masking Optimizations
- Fixed #587 (reported by @TrangOul) by updating
LogEntryEventBuilder
to automatically truncate any provided String parameters before callingapplyDataMaskRules()
. This truncation is somewhat redundant with the string truncation now performed inLoggerDataStore
- but the use of data masking on certain String parameters necessitates an initial truncation before any other parsing occurs- Also removed several internal uses of
truncateFieldValue()
inLogEntryEventBuilder
, now thatLoggerDataStore
will automatically truncate platform event string fields
- Also removed several internal uses of
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.5...v4.12.6
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk5UQAS
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk5UQAS
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5UQAS
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5UQAS
Bugfix: Name Shadowing Issues for Several Schema Apex Classes
Thanks to @amp42 for reporting this bug!
Core Unlocked Package Changes
Switched Using Fully-Qualified Class Names in the Schema
Namespace
-
Fixed #584 (reported by @amp42) by switching to using fully-qualified Apex class references to several classes in the
Schema
namespace, likeSchema.User
, to avoid collision issues in orgs that use name-shadowing classes. These class references are now fully-qualified throughout the codebase. This is the same concept & approach as the changes made inv4.9.0
,v4.9.4
, andv4.9.6
to fully-qualify references to classes & enums in theSystem
namespaceSchema.Account
(these references are only used for tests & sample recipes, not in Nebula Logger's core code)Schema.AuthSession
Schema.LoginHistory
Schema.Network
Schema.Organization
Schema.Profile
Schema.Topic
Schema.TopicAssignment
Schema.User
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.4...v4.12.5
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk5PQAS
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk5PQAS
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5PQAS
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5PQAS
Bugfix: Child Log__c Records Not Properly Linked to Parent Log__c Records
Thanks to @ctcforce for reporting this bug!
Core Unlocked Package Changes
Logger
Apex Class Changes
-
Resolved #585 (reported by @ctcforce) by updating
LogHandler
to handle some scenarios where aLog__c
record would have a value inParentLogTransactionId__c
but anull
value inParentLog__c
. Now in anAFTER_INSERT
context,LogHandler
requeries any potentially orphaned childLog__c
records and links them to their parentLog__c
records. Please note that this does not fix any existing problematic data in your org - it only prevents new problematic records from being created. To fix existing data in an org, you can run this anonymous Apex script:List<Log__c> unlinkedChildLogs = [ SELECT Id, ParentLogTransactionId__c FROM Log__c WHERE ParentLogTransactionId__c != NULL AND ParentLog__c = NULL ]; List<String> parentLogTransactionIds = new List<String>(); for (Log__c unlinkedChildLog : unlinkedChildLogs) { parentLogTransactionIds.add(unlinkedChildLog.ParentLogTransactionId__c); } Map<String, Log__c> parentLogTransactionIdToLog = new Map<String, Log__c>(); for (Log__c parentLog : [SELECT Id, TransactionId__c FROM Log__c WHERE TransactionId__c IN :parentLogTransactionIds]) { parentLogTransactionIdToLog.put(parentLog.TransactionId__c, parentLog); } for (Log__c unlinkedChildLog : unlinkedChildLogs) { unlinkedChildLog.ParentLog__c = parentLogTransactionIdToLog.get(unlinkedChildLog.ParentLogTransactionId__c)?.Id; } update unlinkedChildLogs;
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.3...v4.12.4
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk5KQAS
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk5KQAS
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5KQAS
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5KQAS
Bugfix for UserInfo.getSessionId() Exception
Thanks to @dvanlooy for reporting this bug!
Core Unlocked Package Changes
Logger
Apex Class Changes
- Resolved #598 (reported by @dvanlooy) by adding a
try-catch
block around the usage ofSystem.UserInfo.getSessionId()
- in some situations, such as a connected app using JWT, calling this method will throw an exception - Optimized how
Logger.TRANSACTION_QUIDDITY
is loaded so it doesn't repeatedly try to load in transactions where there isn't an active quiddity
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.2...v4.12.3
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk5AQAS
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk5AQAS
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5AQAS
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk5AQAS
Automatically Select a Default Field Set in LWC relatedLogEntries
Thanks to @shreyas-girjapure for suggesting this enhancement!
Core Unlocked Package Changes
relatedLogEntries
LWC Changes
-
Resolved #596 by automatically setting a default
LogEntry__c
field set when adding the LWCrelatedLogEntries
in App Builder. Previously, admins & developers had to manually select a field set first. -
Added new
LoggerParameter__mdt
recordDefaultLogEntryRelatedListFieldSet
to control which field set is automatically selected as the default. If you have your own field set that you would like to be automatically selected in App Builder, simply update this record with the API name of your own field set.
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.1...v4.12.2
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk55QAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk55QAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk55QAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk55QAC
Improved Error Emails
Thanks so much to @alanjaouen for this release!
Core Unlocked Package Changes
Error Email Notification Changes
- When Nebula Logger has an error (due to a bug, platform limits, etc), an error email is automatically sent to admins using the Apex class
LoggerEmailSender
- these emails previously did not contain enough information to troubleshoot some issues. @alanjaouen reported this in issue #590 and fixed it in PR #591 by updatingLoggerEmailSender
to include the list of relevant fields for any DML failures that can occur (such as creatingLog__c
andLogEntry__c
records).
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.12.0...v4.12.1
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk4bQAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk4bQAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk4bQAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk4bQAC
v4.12.0 - Winter '24 Release
Managed Package Release - v4.12.0
This release is for both the unlocked package (as always), as well as the managed package! You can see everything that's changed between v4.11.0
and v4.12.0
by reviewing:
- The v4.12.0 milestone to see all of the issues & pull requests that are included in the this release.
- The diff between v4.11.0 and v4.12.0 to see all of the code & metadata changes that have been committed since the last managed package release.
✅ For orgs that are upgrading to this version of the managed package: this release now includes, for the first time, CustomIndex
metadata in the managed package. This metadata has already been used in the unlocked packages since v4.10.5
, but was previously excluded in the v4.11.0
release of the managed package due to the metadata type being relatively new. At the moment, there are 2 custom indexes included:
Nebula__Log__c.Nebula__LogRetentionDate__c
- initially introduced in the unlocked package inv4.11.5
Nebula__LogEntry__c.Nebula__OriginLocation__c
- initially introduced in the unlocked package inv4.10.5
These new custom indexes should improve the performance of other metadata that filters on these fields, such as SOQL queries, reports, list views, etc.
Core Unlocked Package Changes - v4.12.0
Winter '24 Release Upgrade
- Updated all metadata to API v59.0 (Winter '24 release)
- Switched from using
Url.getSalesforceBaseUrl()
toUrl.getOrgDomainUrl()
-Url.getSalesforceBaseUrl()
was deprecated in v59.0
Enhancements
- Resolved #571 by adding new formula fields
Log__c.TransactionScenarioText__c
andLogEntry__c.EntryScenarioText__c
that display the corresponding scenario names, stored either in lookups or in text fields. These fields help to simplify reporting & automation that rely on the text value of a scenario's name.
Bugfixes
- Fixed #576 by switching to using a
Map<String, SObject>
internally + replacing null with '' empty string when logging Map<Id, SObject>, and fixed an unreported issue with record stripping not being applied toMap<Id, SObject>
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.11.12...v4.12.0
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001Mk1wQAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk1wQAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk1wQAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk1wQAC
Core Managed Package - Nebula
namespace
Full Changelog: v4.11.0...v4.12.0
- SF CLI:
sf package install --wait 30 --security-type AdminsOnly --package 04t5Y000001Mk21QAC
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001Mk21QAC
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk21QAC
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001Mk21QAC