Releases: jongpie/NebulaLogger
Releases · jongpie/NebulaLogger
LogBatchPurger Bugfixes
- Fixes #146 (again) - chunking errors previously could occur due to trying to use 1 consolidated
List<SObject>
for deletions - updated the code to use 2 lists instead (logs & entries) - Query limit error caused by logs with 200+ log entries - switched to instead querying log entries directly to avoid this issue
Inaccurate Timestamp Bugfix
- Fixes issue #132 (PR #153). Timestamps previously could have been inaccurate if the current user and automated process user had different time zones - internally converting a
String
version ofSystem.now().getTime()
back toDatetime
solves the issue (instead of just using aString
version ofSystem.now()
)
Experience Site Guest Users Bugfix
Unlocked Package
- Production installation URL: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FI1QAM
- Sandbox installation URL: https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000027FI1QAM
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