Skip to content

Releases: jongpie/NebulaLogger

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

Winter '21 Release

17 Oct 18:43
9f1da3b
Compare
Choose a tag to compare

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 in LogEntryBuilder 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 to LogEntryHandler instead (which runs in a separate, async transaction)

External Libraries

  • Upgraded ApexCallouts library to the latest version
  • Eliminated classes Uuid, Uuid_Tests and TestDataFactory

Summer '20 Overhaul

30 Aug 01:15
ae2163c
Compare
Choose a tag to compare

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 as System Mode, stored at the Log__c-level, Any details that are specific to a single entry (Trigger.isExecuting) is still referred to as Context 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 as Logger.debug('my debug message') and Logger.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 new LogEntryBuilder 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

23 Aug 18:04
44f8101
Compare
Choose a tag to compare
Pre-release

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, under nebula-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)

Spring '20 Enhancements

20 Aug 02:37
44f8101
Compare
Choose a tag to compare
Pre-release

API Version Updated

  • Upgraded all metadata to API v48.0 (Spring '20 release)

New Methods

  • Added new methods to Logger for controlling saving
    • suspendSaving() - Temporarily disables any calls to saveLog() during the current transaction. Any log entries are still maintained in the logger's buffer
    • resumeSaving() - Re-enables saving
    • flushBuffer() - Discards any unsaved log entries in the logger's buffer
  • Added new methods to Logger for record-specific log entries
  • Added new method saveLog(Boolean saveLogViaRestApi) which uses a callout to save the logs. This can be used when callouts are being made and DML statements cannot be used due to mixed operations limits

New Classes & Triggers

  • Added LogEntryHandler class and LogEntry trigger to dynamically populate lookup fields referenced in LogEntry__c.RelatedRecordName__c

Removed Code

  • Removed 3rd party integrations (Loggly, Slack & Trello). These will be moved to a separate repository.
  • Eliminated originLocation parameter in all public methods - the private method Logger.getOriginLocation() handles automatically setting the value

Admin Enhancements

  • Added fields on Log__c for storing user & session details
  • Added formula fields on LogEntry__c to simplify showing limits used vs max

Fixed failing unit tests

08 Aug 09:36
8bc9b2b
Compare
Choose a tag to compare
Pre-release

Small patch: Fixed some tests that previously failed if you deployed to production & had existing scheduled jobs. Thanks to @marcellcsiszar for reporting the issue.