Releases: jongpie/NebulaLogger
Topics overloads cleanup
This release only impacts the unlocked package
- Removed all
public
overloads in Logger that usedList<String> topics
as a parameter - these methods are not currently available in the managed package. Topics functionality will be revisited in #90. - Updated Logger.md docs - all references to the Topics overloads have been removed, and some inaccurate ApexDocs details have been corrected
Unlocked Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FGUQA2
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FGUQA2
Unlocked Package Release
A new unlocked package of Logger has been added - you can now choose 3 ways to install Logger in your org
- Install the new unlocked package (recommended) - this new package does not use a namespace. This package provides the advantages of the unpackaged metadata, with the added convenience of being able to easily install, update and uninstall using a 2nd gen package
- Install the managed package - due to Salesforce limitations with namespaced code, the managed package has some limitations (see README.md for details)
- Deploy the unpackaged metadata directly from Github - this provides more or less the same experience as the unlocked package, but requires you to deploy using the metadata API & remove using
destructiveChanges.xml
All metadata in this version is the same metadata in the managed package's release v4.4.0
Unlocked Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FGFQA2
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FGFQA2
Version 4.4.0
Admin & Reporting Enhancements
- #125 - Added field
LoggerSettings__c.DefaultSaveMethod__c
to handle controlling the save method used when callingLogger.saveLog()
- #127 - Added new field Transaction Entry Number on
LogEntryEvent__e
andLogEntry__c
- #133 - Added new field Epoch Timestamp on
LogEntryEvent__e
andLogEntry__c
Bugfixes
- #135 - Fixed "System.QueryException: unexpected token: '('" when querying
Network
object (reported in #131) - Unpackaged version only:
System.debug
is now always called inLogEntryEventBuilder.setMessage(String message)
, even if Logger is disabled
Managed Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027F9wQAE
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027F9wQAE
Version 4.3.0
Admin & Reporting Enhancements
- #108 Added new 'Logger Console' app and custom tab for the
LogEntry__c
object - #123 Added new 'Mass Delete' button on
Log__c
- users with delete permission can select 1 or more logs from a list view and delete them all at once.- Existing orgs using the managed package will need to manually add this button to
Log__c
object's list view layouts underSetup --> Object Manager --> Log__c --> Search Layouts for Salesforce Classic
- Existing orgs using the managed package will need to manually add this button to
- #113 Added new reports for
Log__c
andLogEntry__c
- #103 Added new fields on
Log__c
for the org's Release Cycle, Release Number and Release Version- Several of these fields are retrieved by making a callout to
api.status.salesforce.com
- a remote site setting for this domain is also included. The callout can also be disabled by updating the org defaults inLoggerSettings__c
to setEnableStatusApiCallout__c
= false - Existing orgs (using either the unmanaged metadata or the managed package) should review
LoggerSettings__c
after upgrading and enable the new Status API callout (if desired)
- Several of these fields are retrieved by making a callout to
Log Sharing Enhancements
- #107 Added Apex managed sharing for
Log__c
- logs can now be automatically shared with the userLog__c.LoggedBy__c
- This is configurable in
LoggerSettings__c
- you can set the fieldDefaultLogShareAccessLevel__c
to 'Read' (default), 'Edit' or null (disables automatic sharing) - Existing orgs (using either the unmanaged metadata or the managed package) should review
LoggerSettings__c
after upgrading and configure the new 'Default Log Share Access Level' field (if desired) - This only provides record-level access. In order to see the
Log__c
andLogEntry__c
objects, you will still need to give users access using one of the included permission sets
- This is configurable in
Flow Logging Enhancements
- #105 Added support for logging Flow fault messages. Both invocable classes,
FlowLogEntry
andFlowRecordLogEntry
, now have an optional property,faultMessage
- simply pass the fault message from Flow, and it will be logged as an exception inLogEntry__c
(similar to how Apex exceptions are logged)
Apex Logging Enhancements
- #114 New Logger overloads for logging list parameters, such as
Logger.info('my message, sobjectList)
- The JSON of the lists are stored in the existing fields
LogEntry__c.DatabaseResultJson__c
andLogEntry__c.RecordJson__c
. 2 new fields,DatabaseResultCollectionType__c
andRecordCollectionType__c
can be used to indicate if a single record or list of records was logged - These lists are now supported:
List<SObject>
List<Database.DeleteResult>
List<Database.MergeResult>
List<Database.SaveResult>
List<Database.UpsertResult>
List<Database.UndeleteResult>
- The JSON of the lists are stored in the existing fields
Bugfixes
- #115 Fixed an error with logging a single instance of
Database.Result
when the logging level is disabled for the current user - #118 Fixed upsert logic for
Log__c
to remove code assumption that only 1 transaction ID is present withinLogEntryEvent__e
records
Managed Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000YLDLQA4
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000YLDLQA4
Version 4.2.0 - Expanded fields and Apex methods
Apex
- Added new methods in
Logger
andLogEntryEventBuilder
for logging database 'result' classes as parameters (DeleteResult
,MergeResult
,SaveResult
,UpsertResult
andUndeleteResult
) - Added new WARN overloads in
Logger
to support exception parameters - WARN and ERROR now support the same overloads - Resolved 'Current session unavailable' exception in scheduled jobs by using a new approach to store session details
Data Model
- Added
LogEntryEvent__e
fields for org, user, and record details - Added new
LogEntry__c
field 'record SObject classification' - Added new
Log__c
session fields: login application, login platform and login browser
Log Management
- Fixed some display issues in 'View JSON' quick action on
Log__c
Documentation
- Added link in README.md to GitHub pages with documentation of all Apex
public
andglobal
classes/methods
Managed Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000Xg4wQAC
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000Xg4wQAC
Version 4.0.0 - Managed Package Released
New 2nd Generation Managed Package
- The managed package uses the namespace
Nebula
- you can choose if you want to install the managed package (recommended) or deploy the unpackaged source code - Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000XJZ7QAO
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y000000XJZ7QAO
New Features
- Added new 'Related Log Entries' Lightning web component. Using field sets and App Builder, admins can add the component to any record page
- New log management - new fields & 'Manage Log' quick action provide the ability to track details about each log, such as priority, status, issue, closed/open, closed by, closed date, 'is resolved', etc. Statuses can be configured using
LogStatus__mdt
custom metadata type. - Added new schedulable Apex class
LogBatchPurgeScheduler
for scheduling deletion of old logs - Old aura 'View JSON' cmp is now a wrapper for new Lightning web component
logViewer
- Updated all metadata to API v51.0 (Spring '21 release)
- Update README to include more details & screenshots
Bugfixes
- Resolved an issue where
LogEntry__c.Timestamp__c
was not precise - it now includes an accurate value for milliseconds within the timestamp
Removed Apex Classes
- Removed
FlowLogRepo
- existing orgs should still be able to use it for the foreseeable future - Removed
Callout
andRestApi
classes - these are no longer needed for Logger, but the classes are still available/maintained in a separate ApexCallouts repo
Removed or Changed Apex Methods
Logger
class- Removed
saveLog(Quiddity quiddity)
, and re-addedsaveLog(SaveMethod saveMethod)
+SaveMethod
enum - Removed parameterless logging methods (
error()
,warn()
,info()
,debug()
,fine()
,finer()
,finest()
) (they're now private) - Replaced
createLogEntryEventBuilder()
with newEntry() method (with overloads)
- Removed
LogEntryBuilder
class- Removed method
setUserSessionDetails()
(it's now private) - Removed
alwaysSave()
method - new approach isLogger.newEntry(loggingLevel, message, true);
- Removed method
Custom Fields Cleanup
In preparation for releasing a managed package, several fields have been either deleted or renamed. Existing orgs using an older version can delete these fields after installing the latest version - these fields will no longer be used going forward.
Log Entry Event platform event object
LogEntryEvent__e.ProfileName__c
LogEntryEvent__e.RelatedRecordId__c
(renamed toLogEntryEvent__e.RecordId__c
)LogEntryEvent__e.RelatedRecordJson__c
(renamed toLogEntryEvent__e.RelatedRecordJson__c
)LogEntryEvent__e.UserRoleName__c
Log custom object
Log__c.SystemModeIsApexRest__c
Log__c.SystemModeIsBatch__c
Log__c.SystemModeIsFuture__c
Log__c.SystemModeIsQueueable__c
Log__c.SystemModeIsScheduledJob__c
Log__c.SystemModeIsScheduled__c
Log__c.TotalLogEntriesWithRelatedRecordId__c
(renamed toLog__c.TotalLogEntriesWithRecordId__c
)
Log Entry custom object
LogEntry__c.HasRelatedRecordId__c
(renamed toLogEntry__c.HasRecordId__c
)LogEntry__c.HasRelatedRecordJson__c
(renamed toLogEntry__c.HasRecordJson__c
)LogEntry__c.RelatedRecordDetailedLink__c
(renamed toLogEntry__c.RecordDetailedLink__c
)LogEntry__c.RelatedRecordId__c
(renamed toLogEntry__c.RecordId__c
)LogEntry__c.RelatedRecordJson__c
(renamed toLogEntry__c.RecordJson__c
)LogEntry__c.RelatedRecordLink__c
(renamed toLogEntry__c.RecordLink__c
)LogEntry__c.RelatedRecordName__c
(renamed toLogEntry__c.RecordName__c
)LogEntry__c.RelatedRecordSObject__c
(renamed toLogEntry__c.RecordSObject__c
)LogEntry__c.RelatedAccount__c
LogEntry__c.RelatedCase__c
LogEntry__c.RelatedLead__c
LogEntry__c.RelatedUser__c
Logger Settings custom setting object
LoggerSettings__c.GenerateDebugStatements__c
LoggerSettings__c.StoreRelatedRecordJson__c
LoggerSettings__c.StoreStackTrace__c
Winter '21 Release
Updated all metadata to API v50.0 (Winter '21 release)
New Features & Enhancements
PR | Area | Summary |
---|---|---|
#28 | Overall | Logger.getTransactionId() now uses Apex's new Quiddity Request ID |
#44 | Reporting | Added new fields on Log__c for details about Community, Organization and User License |
#55 | UI | Switched to using Dynamic Forms for Log__c and LogEntry__c |
#52 | UI | 'View JSON' quick action improved - added a 'copy JSON to clipboard' button & modal is now larger |
#57 | Log Batch Deletion | Added new field Log__c.LogRetentionDate__c to control which records are deleted in LogBatchPurger job |
#45 | Flow | Added quality of life improvements for Flow usage - categorization, plus ability to retrieve latest created log via Flow |
#36, #51 | Apex & Flow | Related SObject records are now stored automatically as JSON in the new field LogEntry__c.RelatedRecordJson__c |
#35 | Apex | The Apex stack trace for each log entry are now automatically stored in the new field LogEntry__c.StackTrace__c |
#34 | Apex | Added LogMessage class to support more advanced methods of setting LogEntry__c.Message__c |
Optimizations
- Reduced CPU usage in
LogEntryBuilder
. Previously, logic inLogEntryBuilder
methods still executed, even if the entry's logging level was disabled. Additional checks have been added to only run the methods if the logging level is enabled. - Eliminated a SOQL query in
LogEntryBuilder
and moved toLogEntryHandler
instead (which runs in a separate, async transaction)
External Libraries
- Upgraded ApexCallouts library to the latest version
- Eliminated classes
Uuid
,Uuid_Tests
andTestDataFactory
Summer '20 Overhaul
This release changes most of the method signatures in Logger & will break existing projects. Any existing code will need to be updated to use the new methods. Several fields have also been renamed in this release.
Terminology Changes
- Log Entry Types: the type 'debug' has been renamed to 'diagnostic' to avoid confusion with the DEBUG logging level
- System Mode vs Context: any transaction details that applies to the entire transaction (
System.isFuture()
,System.isBatch()
, etc) are now referred to asSystem Mode
, stored at the Log__c-level, Any details that are specific to a single entry (Trigger.isExecuting
) is still referred to asContext
and is still stored at the LogEntry__c-level.
New Features
- Added
Logger.saveLog(SaveMethod saveMethod)
. Currently, it supports saving via DML statements, REST API, or a new queuable job (useful for saving logs asynchronously). - New
Logger
method naming convention. Logger now uses a method naming convention based on the desired logging level, such asLogger.debug('my debug message')
andLogger.warn('my warning message')
. Each logging level's methods have been overloaded to support both simple & complex logging needs.
** For advanced logging news, the parameterless version of each method returns a newLogEntryBuilder
object, which provides more control over how the log entries are generated. - Added new 'Logger' methods for settings-related details, including
Logger.getUserLoggingLevel
Logger.isEnabled()
,Logger.isDebugEnabled()
,Logger.isInfoEnabled()
, etc. - Add 'View JSON' quick action button on Log__c to see the log and its entries in JSON format
- Added new
LoggerLogViewer
permission set to give view-all access for the Log__c and LogEntry__c objects - Added additional list views on Log__c
SFDX Metadata Conversion
This release just covers converting the repo to use the SFDX metadata structure - no functional changes have been made.
- The existing metadata has been converted from the old
src
folder format to the new SFDX folder structure, undernebula-app-framework
. Other related repos will eventually be updated to use this same structure. - Dependencies (metadata used from separate projects) have been placed in their own subfolders.
- Updated .travis.yml to use SFDX (instead of jsforce)