Releases: jongpie/NebulaLogger
Deprecated & replaced BrowserUrl__c fields with new BrowserAddress__c fields
Thanks to @Ben-Nathan-CTM for reporting this bug!
Core Unlocked Package Changes
This release fixes #696 by making a couple of changes to how the browser's address is captured when logging in lightning components
- Updated the Apex class
ComponentLogger
to auto-truncate JS browser fields (includingLogEntryEvent__c.BrowserUrl__c
)- The
public
propertyComponentLogger.ComponentLogEntry.browserUrl
is now deprecated & will be deleted in a future release. It's only intended to be used internally by Nebula Logger, so this hopefully doesn't impact anyone - but mentioning it here, just in case 😉
- The
- Replaced the text (255) fields
BrowserUrl__c
onLogEntryEvent__e
andLogEntry__c
with new long textarea (2000) fieldsBrowserAddress__c
- The existing
BrowserUrl__c
fields are too short to store some long URLs (such as URLs with a lot of parameters), and the existing fields can't be converted from text(255) to long text area fields, so new fields are needed - The existing
BrowserUrl__c
fields will still be populated for foreseeable future (with a truncated value), but they are now considered deprecated - any references in reports, list views, queries, etc. should be updated to use the newBrowserAddress__c
fields
- The existing
- Documentation: added missing data classification metadata to several existing browser fields on
LogEntryEvent__e
andLogEntry__c
- This doesn't impact any functionality, it's just for documentation purposes
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.14...v4.13.15
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oF5QAI
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oF5QAI
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oF5QAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oF5QAI
Custom Field Mappings Support
Thanks to @pankaj0509 and @codejester90 for suggesting this enhancement & providing some great feedback!
Core Unlocked Package Changes
This release resolves #655 by adding support for defining, setting, and mapping custom fields within Nebula Logger's data model. This is helpful in orgs that want to extend Nebula Logger's included data model by creating their own org/project-specific fields.
Adding custom fields to the platform event LogEntryEvent__e
To get started, the first step is to add a field to the platform LogEntryEvent__e`
-
Create your own custom fields on
LogEntryEvent__e
. Any data type supported by platform events can be used. -
Populate your own custom fields in Apex by calling one of the two new instance methods on
LogEntryEventBuilder
:setField(Schema.SObjectField field, Object fieldValue)
setField(Map<Schema.SObjectField, Object> fieldToValue)
For now, this functionality is available in Apex. Long-term, equivalent functionality will hopefully be added for Flow & Lightning Components. Here is an example of using the 2 new methods in Apex:
Logger.info('hello, world')
// Set a single field
.setField(LogEntryEvent__e.SomeCustomTextField__c, 'some text value')
// Set multiple fields
.setField(new Map<Schema.SObjectField, Object>{
LogEntryEvent__e.AnotherCustomTextField__c => 'another text value',
LogEntryEvent__e.SomeCustomDatetimeField__c => System.now()
});
Adding custom fields to the custom objects Log__c
, LogEntry__c
, and LoggerScenario__c
If you want to store the data in one of Nebula Logger's custom objects, you can follow the above steps, and also...
-
Create an equivalent custom field on one of Nebula Logger's custom objects - right now, only
Log__c
,LogEntry__c
, andLoggerScenario__c
are supported. -
In this example, a custom text field also called
SomeCustomField__c
has been added toLog__c
object - this will be used to store the value of the fieldLogEntryEvent__e.SomeCustomField__c
: -
Create a record in the new CMDT
LoggerFieldMapping__mdt
to map theLogEntryEvent__e
custom field to the custom object's custom field, shown below. Nebula Logger will automatically populate the custom object's target field with the value of the sourceLogEntryEvent__e
field.
New extra-tests
Metadata
To help with testing Nebula Logger, a few new metadata items have been added to the extra-tests
directory. This directory is not included in any of Nebula Logger's packages - its metadata is used to help both with automated tests in the pipeline, as well as manual functional tests.
- Added some new custom fields for the objects
LogEntryEvent__e
,Log__c
,LogEntry__c
, andLoggerScenario__c
to theextra-tests
directory to provide sample fields that are only used for testing the custom field mapping functionality - Added some new CMDT records for the new object
LoggerFieldMapping__mdt
. These records map the (new) included custom fields (mentioned above)
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.13...v4.13.14
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oE2QAI
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oE2QAI
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oE2QAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oE2QAI
Improved Fully-Qualified References
Since the unlocked package does not have a namespace, orgs can encounter installation errors for Nebula Logger if the target org has any custom Apex code (classes, enums, interfaces, etc.) with the same name as standard class in the Schema
or System
namespace (referred to as name shadowing).
This is the same concept & approach as the changes made in several previous releases (listed below) - but my hope is that this PR finally finishes this effort, and all references are now fully qualified.
This shouldn't cause any functional changes to Nebula Logger - this is to tidy up existing references to avoid name collisions so that more orgs can use the unlocked package.
Core Unlocked Package Changes
Apex Code Changes
-
Switched to using fully-qualified references for these standard classes in the
Schema
andSystem
namespaces :Schema
namespace standard classesApexClass
→Schema.ApexClass
ApexEmailNotification
→Schema.ApexEmailNotification
ApexTrigger
→Schema.ApexTrigger
AsyncApexJob
→Schema.AsyncApexJob
BatchApexErrorEvent
→Schema.BatchApexErrorEvent
CustomPermission
→Schema.CustomPermission
DisplayType
→Schema.DisplayType
FlowDefinitionView
→Schema.FlowDefinitionView
FlowExecutionErrorEvent
→Schema.FlowExecutionErrorEvent
FlowVersionView
→Schema.FlowVersionView
PermissionSet
→Schema.PermissionSet
PermissionSetAssignment
→Schema.PermissionSetAssignment
SoapType
→Schema.SoapType
UserRecordAccess
→Schema.UserRecordAccess
UserRole
→Schema.UserRole
System
namespace standard classesBatchableContext
→System.BatchableContext
Comparable
→System.Comparable
Database
→System.Database
EventBus
→System.EventBus
FinalizerContext
→System.FinalizerContext
InstallHandler
→System.InstallHandler
JSON
→System.JSON
Matcher
→System.Matcher
Pattern
→System.Pattern
PicklistEntry
→System.PicklistEntry
Queueable
→System.Queueable
QueueableContext
→System.QueueableContext
Quiddity
→System.Quiddity
Request
→System.Request
RestContext
→System.RestContext
RestRequest
→System.RestRequest
RestResponse
→System.RestResponse
Schedulable
→System.Schedulable
SchedulableContext
→System.SchedulableContext
Search
→System.Search
TriggerOperation
→System.TriggerOperation
UUID
→System.UUID
-
Scope creep: fixed some flaky tests in
LogBatchPurgeController_Tests
extra-tests
Metadata Changes
- Moved the existing name-shadowing classes in the
extra-tests
directory to be in separate subdirectories (one for each namespace,Schema
andSystem
) - Added several new name-shadowing classes for all of the
Schema
&System
references (mentioned above) that are now using fully-qualified references- These classes are deployed in Nebula Logger's pipeline to enforce that the codebase uses fully-qualified references
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.12...v4.13.13
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oDsQAI
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oDsQAI
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oDsQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oDsQAI
Added refresh button + spinner on relatedLogEntries LWC
Thanks to @andrii-solokh for implementing this enhancement! (PR #703)
Core Unlocked Package Changes
-
Added new
refresh
button on the LWCrelatedLogEntries
. This makes it easy to refresh just the list ofLogEntry__c
records, without having to refresh the entire page- When refreshing the data, a
lightning-spinner
is now overlayed on the LWC
- When refreshing the data, a
New extra-tests
Metadata
- Added sample flexipage
Nebula_Logger_Account_Record_Page
that's used as the org default for theAccount
object when deploying Nebula Logger'sextra-tests
folder - this makes it easy to test the LWCrelatedLogEntries
in a scratch org
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.11...v4.13.12
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000015oCkQAI
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000015oCkQAI
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oCkQAI
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015oCkQAI
Added tracking of logging user's federation identifier
Core Unlocked Package Changes
This release adds new fields & automation to track the logging user's federation identifier - this field is used in SAML SSO (Single Sign-On) settings, and is often a person's unique identifier in multiple systems. By capturing it in Nebula Logger, it makes it easier for Salesforce logs to be tied to logs for the same user in other systems.
-
Added new long textarea (512) fields
LoggedByFederationIdentifier__c
onLogEntryEvent__e
andLog__c
to track the value ofSchema.User.FederationIdentifier
for the logging user -
Added new field
Log__c.HasLoggedByFederationIdentifier__c
to make it easier to filter/identify records where the user's federation ID has been populated -
Added field-level security (FLS) for the new
Log__c
fields to the permission setsLoggerAdmin
,LoggerLogViewer
, andLoggerEndUser
-
Added new field
Log__c.LoggedByFederationIdentifier__c
to the flexipageLogRecordPage
- it conditionally shows, based on the value of the other new field,Log__c.HasLoggedByFederationIdentifier__c
Big Object Archive Plugin Changes
- Renamed the Big Object index
LogEntryArchiveIndex.indexe-meta.xml
toLogEntryArchiveIndex.index-meta.xml
(indexe
-->index
) to fix an issue with newer versions of thesf
cli- This doesn't impact any functionality in the plugin, so there is not a new release for the plugin - just a small change to the metadata in the repo
Pipeline Changes
- Deleted several old scripts in
package.json
and in the directory./scripts/build
- Upgraded package dependencies & regenerated
package-lock.json
- Tweaked config in
.prettierrc
- Updated GitHub Actions in
build.yml
to use v4 (compatible with Node 20)
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.10...v4.13.11
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000027L98QAE
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000027L98QAE
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L98QAE
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L98QAE
AuthSession Bugfix for LWC Logging
Thanks to @Suryansh-2301 for reporting this bug!
Core Unlocked Package Changes
- Fixed #678 by removing the filter
ParentId = null
when queryingAuthSession
data inLoggerEngineDataSelector
- Added a small enhancement to store the
ParentId
of theAuthSession
record in the new fieldsLogEntryEvent__e.ParentSessionId__c
andLog__c.ParentSessionId__c
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.9...v4.13.10
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y0000027L04QAE
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y0000027L04QAE
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L04QAE
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027L04QAE
Updated Logging Level Emojis
Thanks to @twentyTwo for suggesting & implementing these changes, and thanks to @PawelWozniak for the feedback!
Core Unlocked Package Changes
- Closed #665 in PR #672 by updating the formula field
LogEntry__c.LoggingLevelWithImage__c
to use different emojis for every logging level to make it easier to visually distinguish between them. Previously, the same emoji was used forDEBUG
,FINE
,FINER
, andFINEST
. The new list of emojis used are:ERROR
=> ⛔WARN
=>⚠️ DEBUG
=> 🐞INFO
=> ℹ️FINE
=> 👍FINER
=> 👌FINEST
=> 🌟
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.8...v4.13.9
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001MkHqQAK
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001MkHqQAK
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHqQAK
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHqQAK
Fixed logEntryMetadataViewer LWC's 'View Full Source' button not showing for non-admins
Core Unlocked Package Changes
-
Worked with @jamessimone to troubleshoot & fix some additional issues in the
logEntryMetadataViewer
LWC that prevented the 'View Full Source' button from showing up for non-admins. This involved 3 related changes- Added ApexClass access in the permission sets
LoggerAdmin
,LoggerLogViewer
,LoggerEndUser
for the Apex classLogEntryMetdataViewerController
to fix some permission errors that could occur in some orgs/situations. - Fixed some excessively large whitespace in the LWC caused by a present-but-not-visible spinner.
- Updated the
logEntryMetadataViewer
LWC to imperatively call Apex controller methods - using the@wire
annotation caused weird, silent failures when calling the Apex methods, but calling it imperatively seems to work wonderfully (and is more consistent with how the other LWCs in Nebula Logger are written).
- Added ApexClass access in the permission sets
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.7...v4.13.8
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001MkHbQAK
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001MkHbQAK
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHbQAK
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHbQAK
Fixed setScenario() function in logger LWC
Thanks to @rcastanosgonzalez for reporting and fixing this bug!
Core Unlocked Package Changes
- Fixed #666 issue in PR #667 by updating the logger LWC's function
setScenario()
to properly (and always) set the scenario on each log entry. Previously, the value was often incorrectly set tonull
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.6...v4.13.7
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001MkHRQA0
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001MkHRQA0
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHRQA0
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkHRQA0
View Log Entry Metadata custom permission
Core Unlocked Package Changes
- Added new custom permission
CanViewLogEntryMetadata
so that users without query access toApexClass
andApexTrigger
can still see the source code in the LWClogEntryMetadataViewer
- Updated the permission set
LoggerAdmin
to assign the new custom permissionCanViewLogEntryMetadata
- Added some more test methods in
LogEntryMetadataViewerController_Tests
, and cleaned up some code inLogEntryMetadataViewerController
Installation Info
Core Unlocked Package - no namespace
Full Changelog: v4.13.5...v4.13.6
- SF CLI:
sf package install --wait 20 --security-type AdminsOnly --package 04t5Y000001MkGxQAK
- SFDX CLI:
sfdx force:package:install --wait 20 --securitytype AdminsOnly --package 04t5Y000001MkGxQAK
- Sandbox: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkGxQAK
- Production: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000001MkGxQAK