Skip to content

Releases: jongpie/NebulaLogger

LogBatchPurger Bugfixes

27 May 23:05
b91181a
Compare
Choose a tag to compare
  • 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

27 May 20:54
6c10de1
Compare
Choose a tag to compare
  • 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 of System.now().getTime() back to Datetime solves the issue (instead of just using a String version of System.now())

Experience Site Guest Users Bugfix

26 May 15:07
06b4e9b
Compare
Choose a tag to compare
  • #152 Fixed logging failing for Experience Site guest users (reported in #145)

Unlocked Package

Topics overloads cleanup

24 May 19:11
5a7d6d1
Compare
Choose a tag to compare

This release only impacts the unlocked package

  • Removed all public overloads in Logger that used List<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

Unlocked Package Release

23 May 19:09
7ac32e5
Compare
Choose a tag to compare

A new unlocked package of Logger has been added - you can now choose 3 ways to install Logger in your org

  1. 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
  2. Install the managed package - due to Salesforce limitations with namespaced code, the managed package has some limitations (see README.md for details)
  3. 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

Version 4.4.0

20 May 05:31
d52be40
Compare
Choose a tag to compare

Admin & Reporting Enhancements

  • #125 - Added field LoggerSettings__c.DefaultSaveMethod__c to handle controlling the save method used when calling Logger.saveLog()
  • #127 - Added new field Transaction Entry Number on LogEntryEvent__e and LogEntry__c
  • #133 - Added new field Epoch Timestamp on LogEntryEvent__e and LogEntry__c

Bugfixes

  • #135 - Fixed "System.QueryException: unexpected token: '('" when querying Network object (reported in #131)
  • Unpackaged version only: System.debug is now always called in LogEntryEventBuilder.setMessage(String message), even if Logger is disabled

Managed Package

Version 4.3.0

28 Mar 22:35
bdd3c14
Compare
Choose a tag to compare

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 under Setup --> Object Manager --> Log__c --> Search Layouts for Salesforce Classic
  • #113 Added new reports for Log__c and LogEntry__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 in LoggerSettings__c to set EnableStatusApiCallout__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)

Log Sharing Enhancements

  • #107 Added Apex managed sharing for Log__c - logs can now be automatically shared with the user Log__c.LoggedBy__c
    • This is configurable in LoggerSettings__c - you can set the field DefaultLogShareAccessLevel__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 and LogEntry__c objects, you will still need to give users access using one of the included permission sets

Flow Logging Enhancements

  • #105 Added support for logging Flow fault messages. Both invocable classes, FlowLogEntry and FlowRecordLogEntry, now have an optional property, faultMessage - simply pass the fault message from Flow, and it will be logged as an exception in LogEntry__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 and LogEntry__c.RecordJson__c. 2 new fields, DatabaseResultCollectionType__c and RecordCollectionType__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>

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 within LogEntryEvent__e records

Managed Package

Version 4.2.0 - Expanded fields and Apex methods

09 Mar 02:33
7944b0d
Compare
Choose a tag to compare

Apex

  • Added new methods in Logger and LogEntryEventBuilder for logging database 'result' classes as parameters (DeleteResult, MergeResult, SaveResult, UpsertResult and UndeleteResult)
  • 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 and global classes/methods

Managed Package

Version 4.0.0 - Managed Package Released

25 Feb 02:50
b1d1f59
Compare
Choose a tag to compare

New 2nd Generation Managed Package

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 and RestApi 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-added saveLog(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)
  • LogEntryBuilder class
    • Removed method setUserSessionDetails() (it's now private)
    • Removed alwaysSave() method - new approach is Logger.newEntry(loggingLevel, message, true);

Custom Fields Cleanup

28 Oct 20:31
8418a16
Compare
Choose a tag to compare

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 to LogEntryEvent__e.RecordId__c)
  • LogEntryEvent__e.RelatedRecordJson__c (renamed to LogEntryEvent__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 to Log__c.TotalLogEntriesWithRecordId__c)

Log Entry custom object

  • LogEntry__c.HasRelatedRecordId__c (renamed to LogEntry__c.HasRecordId__c)
  • LogEntry__c.HasRelatedRecordJson__c (renamed to LogEntry__c.HasRecordJson__c)
  • LogEntry__c.RelatedRecordDetailedLink__c (renamed to LogEntry__c.RecordDetailedLink__c)
  • LogEntry__c.RelatedRecordId__c (renamed to LogEntry__c.RecordId__c)
  • LogEntry__c.RelatedRecordJson__c (renamed to LogEntry__c.RecordJson__c)
  • LogEntry__c.RelatedRecordLink__c (renamed to LogEntry__c.RecordLink__c)
  • LogEntry__c.RelatedRecordName__c (renamed to LogEntry__c.RecordName__c)
  • LogEntry__c.RelatedRecordSObject__c (renamed to LogEntry__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