Skip to content

Releases: jongpie/NebulaLogger

New Logger.exception() methods for Apex developers

08 Aug 20:13
a08e1d6
Compare
Choose a tag to compare

Core Unlocked Package Changes

New Logger.exception() methods for Apex developers

This release provides some syntactic sugar for Apex developers when logging exceptions. A common pattern for using Nebula Logger is to log exceptions in try-catch blocks. Once an exception has been caught, Apex developers have to add 3 lines of code in order to log the exception & re-throw it, as shown below:

try {
    insert new Account();
} catch (System.Exception ex) {
    Logger.error('something broke 😥', ex);
    Logger.saveLog(Logger.SaveMethod.EVENT_BUS);
    throw ex;
}

Although 3 lines of code isn't a huge amount of code, it's still tedious to have to repeat the same code in any relevant try-catch blocks. Now, Apex developers can use the new method overloads Logger.exception() to consolidate down to 1 line in a catch block. The end result of the below snippet is identical to the snippet above - both result in a new ERROR log entry being generated, automatically saved, and then the exception is thrown.

try {
    insert new Account();
} catch (System.Exception ex) {
    Logger.exception('something broke 😥', ex);
}

The full list of new Logger.exception() method overloads is shown below. Each of the methods will log an entry with ERROR logging level, save the log, and then throw the provided exception. Since an exception is always thrown, the method overloads all have a void return type.

global static void exception(LogMessage logMessage, System.Exception apexException);
global static void exception(LogMessage logMessage, Id recordId, System.Exception apexException);
global static void exception(LogMessage logMessage, SObject record, System.Exception apexException);
global static void exception(LogMessage logMessage, List<SObject> records, System.Exception apexException);
global static void exception(String message, System.Exception apexException);
global static void exception(String message, Id recordId, System.Exception apexException);
global static void exception(String message, SObject record, System.Exception apexException);
global static void exception(String message, List<SObject> records, System.Exception apexException);

Bugfixes

  • Bugfix for issue #529 where the optional integration with api.status.salesforce.com would cause exceptions in Nebula Logger if the remote site setting was disabled and the callout was still enabled via LoggerParameter__mdt record CallStatusApi. Now, Nebula Logger internally catches any callout exceptions, which should prevent any downstream issues from occurring.

Apex Test Improvements

  • Scope creep: finished a few TODO items in the Apex class Logger_Tests (part of the logger engine layer) so that it's not aware of the log-management layer by rewriting several test methods to remove references to Log__c and LogEntry__c. These tests now also use mocks for the System.EventBus class, so they're now much faster 🏎️

Pipeline Enhancements

  • @JMercie closed issue #527 by updating Nebula Logger's pipeline & build scripts to use the new sf CLI, instead of the sfdx cli` (PR #532). Thanks to @JMercie for another amazing contribution! 🥳

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.11.1...v4.11.2

Added the Ability to Throw Fault Exception in Flow Actions

28 Jul 14:48
c4d3987
Compare
Choose a tag to compare

A huge thank you to @JMercie for working on this release, and congratulations on their first-ever open source contribution! (PR #516). And many thanks also to @Sidle for suggesting this great enhancement (issue #489).

Core Unlocked Package Changes

Added the Ability to Throw Fault Exceptions in Flow Actions

This release closes #489 by providing a new option when logging in Flow - when logging a Flow fault message (shown as 1 in the screenshot below), you can now have the invocable action automatically re-throw the encountered exception (shown as 2 in the screenshot below). This provides a great way to still display an error to the user & rollback any other DML in the current transaction, while still saving your logging data.

  • Updated all 3 Flow invocable logging actions (Apex classes FlowLogEntry, FlowRecordLogEntry, and FlowCollectionLogEntry) to have a new optional Boolean property, shouldThrowFaultMessageException. When set to true, the provided Flow fault message (using the String property faultMessage) will be used to create & throw an instance of the standard exception class System.FlowException
  • Updated FlowLogger to handle throwing the exception for all 3 Flow invocable logging actions

image

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.11.0...v4.11.1

v4.11.0 - Summer '23 Release

29 Jun 17:12
a834b5a
Compare
Choose a tag to compare

Managed Package Release - v4.11.0

This release is for both the unlocked package (as always), as well as the managed package! You can see everything that's changed between v4.10.0 and v4.11.0 by reviewing:

  • The v4.11.0 milestone to see all of the issues & pull requests that are included in the this release.
  • The diff between v4.10.0 and v4.11.0 to see all of the code & metadata changes that have been committed since the last managed package release.

⚠️ For orgs that are upgrading to this version of the managed package: two details to be aware of:

  1. The enhancement from is purposefully being excluded from the managed package for this release. Release v4.10.5 added a custom index to the field LogEntry__c.OriginLocation__c to help optimize anything that filters on this field, such as SOQL queries, list views, reports, etc. This was implemented using the recently-added metadata type CustomIndex, which is considered generally-available (GA). However, there have been a handful of related errors reported due to the CustomIndex metadata, so it's being excluded from the managed package this release as a precaution to avoid any related upgrade issues.
  2. There are some recent label changes to some existing metadata - most notably, the new lightning app "Logger Console" has been relabeled to "Nebula Logger". This change will not be automatically applied to orgs that are upgrading - you will continue to see the lightning app labeled as "Logger Console" in your org. It is completely your choice if you would like to keep the existing label, or manually relabel it in your org. If you would like to relabel it in your org, you can edit it under Setup --> App Manager --> edit the Logger Console app.

Core Unlocked Package Changes - v4.11.0

Metadata API Version Updated to v58.0

  • Updated all metadata to API v58.0 (Summer '23 release)
  • Updated some picklist values to have options for API v58.0 and 59.0
  • Simplified some Apex calls to String.join() to remove extra conversions of Set<String> to List<String> - Summer '23 now supports iterating over Set<Object>
  • Retrieved the metadata for fields & objects so the repo's version more closely matches the XML returned by the platform

logEntryEventStream LWC Enhancements

Currently, the LWC logEntryEventStream uses the emp API to subscribe/display the stream of LogEntryEvent__e platform events, which counts towards your org's daily limit for platform event delivery allocation (the docs for Platform Event Allocations has more details on this limit).

To help mitigate the usage of the org daily limit for platform event daily delivery allocations, this release includes 2 related changes:

  • Added new control "Max Number of Events to Stream" (shown as #1 in the screenshot below) to set the max number of events to deliver to the LWC before the component auto-pauses the stream. A counter of the total number of events streamed for your session has also been added (shown as #2 in the screenshot below), as well as a <lightning-progress-ring> to show the percentage of events to stream before the component auto-pauses itself (shown as #3 in the screenshot below)

    image

  • Resolved #488 by adding new LoggerParameter__mdt record EnableLogEntryEventStream - when set to false, the entire component is completely disabled for the entire organization. The buttons on the LWC are hidden, input elements are disabled, and a warning message is displayed:

    image

loggerHomeHeader LWC Enhancements

  • Added plugin information to the header component in 2 places:
    • Added a count of enabled plugins directly below the lightning card's title. This only displays when 1 or more plugins are enabled in your org (not available in the managed package)

      image

    • Added a comma-separated list of enabled plugins to 'Environment Details' button modal. This only displays when 1 or more plugins are enabled in your org (not available in the managed package)

      image

LoggerHomePage FlexiPage Changes

  • Updated the LoggerAdmin dashboard component on the LoggerHomePage FlexiPage to not hide the dashboard on error (controlled by updating the componentInstanceProperties attribute hideOnError to false - shown in App Builder with MS Paint's amazing ⚡ shape in the screenshot below). Previously, if the dashboard had any errors (such as permission issues with the running user), the home page just displayed an unhelpful empty space in place of the dashboard, making it hard to tell if the page had loaded properly or if the dashboard had an error. Now, the dashboard will display either way.

    image

LoggerAdmin Dashboard Changes

  • Removed the XML node <runningUser>test-triqc8kt7jj0@example.com</runningUser> in LoggerAdmin.dashboard-meta.xml that caused problems for orgs that deploy the metadata (instead of using the unlocked or managed packages)
    • This value was from a scratch org used for building the dashboard, and including it in the metadata worked fine when deploying to other scratch orgs & when creating/installing package versions (even though that particular username would not exist in other orgs). However, when deploying Nebula Logger's metadata to production orgs, the deployment would fail due to not being able to find the matching user. Removing the XML node entirely avoids the deployment issue altogether, and seems cleaner than storing a random scratch org username inside of git

More Label Changes

  • Updated the labels for several metadata items to start with "Nebula Logger" (instead of just "Logger") for clarity on what metadata is part of Nebula Logger - this is especially helpful in orgs that deploy the metadata (instead of using the unlocked or managed packages). The changed metadata includes:
    • AnimationRule
    • CustomPermission
    • FlexiPage
    • GlobalValueSet
    • LWCs
    • Permission Sets
    • Visualforce page

Updated Permission Sets

  • Small bugfix from v4.10.6 release - updated the LoggerAdmin & LoggerLogViewer permission sets to add missing Apex class access to LoggerHomeHeaderController

README.md, Pipeline & Release Notes Changes

  • Updated README.md to include the package installation command for the SF CLI (in addition to the SFDX CLI)
  • Updated README.md to use the "classic" commands for SFDX CLI to better support people that are still using older versions of the SFDX CLI
  • Updated the pipeline's pwsh script so it automatically update the package version ID in README.md for the new SF CLI command
  • Updated release notes to start including the SF CLI command (see below!)

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.6...v4.11.0

Core Managed Package - Nebula namespace

Full Changelog: v4.9.0...v4.10.0

Added More Fields on LogEntryEvent__e, Log__c, and LogEntry__c

05 Jun 21:54
36f7440
Compare
Choose a tag to compare

This release is focused on automatically capturing & storing some new data points (in a few different areas) that provide additional context for monitoring & reporting.

Core Unlocked Package Changes

Logging in Lightning Components: New "Browser Details" fields on LogEntry__c

  • Resolved #225 by updating the logger LWC (logEntryBuilder.js mostly) to capture details about the user's browser & screen. These details are automatically now stored in these new fields on LogEntryEvent__e and LogEntry__c:

    New Fields Source of Data
    LogEntryEvent__e.BrowserFormFactor__c and LogEntry__c.BrowserFormFactor__c The value of FORM_FACTOR, imported using import FORM_FACTOR from '@salesforce/client/formFactor';
    LogEntryEvent__e.BrowserLanguage__c and LogEntry__c.BrowserLanguage__c The value of window.navigator.language
    LogEntryEvent__e.BrowserScreenResolution__c and LogEntry__c.BrowserScreenResolution__c The value of window.screen.availWidth + ' x ' + window.screen.availHeight
    LogEntryEvent__e.BrowserUrl__c and LogEntry__c.BrowserUrl__c The value of window.location.href
    LogEntryEvent__e.BrowserUserAgent__c and LogEntry__c.BrowserUserAgent__c The value of window.navigator.userAgent
    LogEntryEvent__e.BrowserWindowResolution__c and LogEntry__c.BrowserWindowResolution__c The value of window.innerWidth + ' x ' + window.innerHeight

Logging in Flow: New Flow Metadata fields on LogEntry__c

  • Resolved #451 by capturing some additional details about the running Flow via the object FlowDefinitionView. These details are automatically now stored in these new fields:

    New Fields Source of Data
    LogEntry__c.FlowRecordTriggerType__c The value of FlowDefinitionView.RecordTriggerType
    LogEntry__c.FlowTriggerOrder__c The value of FlowDefinitionView.TriggerOrder
    LogEntry__c.FlowTriggerSObjectType__c The value of FlowDefinitionView.TriggerObjectOrEvent.QualifiedApiName

Organization Details: New & Deprecated fields on LogEntryEvent__e and Log__c

  • "Renamed" (by creating new fields) some fields on LogEntryEvent__e and Log__c to have a more consistent naming convention. Note that the old fields are still included in the core package and are still populated so that orgs have time to update any existing reporting, etc. Eventually, the old fields will be fully removed from the package.

    Field Change Source of Data
    Deprecated Log__c.ApiReleaseNumber__c and replaced it with Log__c.OrganizationReleaseNumber__c Retrieved via the optional callout to https://api.status.salesforce.com
    Deprecated Log__c.ApiReleaseVersion__c and replaced it with Log__c.OrganizationReleaseVersion__c Retrieved via the optional callout to https://api.status.salesforce.com
    Deprecated LogEntryEvent__e.ApiVersion__c and Log__c.ApiVersion__c and replaced them with LogEntryEvent__e.OrganizationApiVersion__c and Log__c.OrganizationApiVersion__c The value of Logger.getOrganizationVersion()
    Added new field Log__c.OrganizationLocation__c Retrieved via the optional callout to https://api.status.salesforce.com

Logger Engine Changes

  • Made some internal changes to the logger LWC so that the JavaScript code's approach more closely aligns with the Apex code's approach. This should not have any functional changes (hopefully 😅), this is just to try to provide a little more consistency within the codebase for approaching the same goal (logging) in 2 different languages (Apex & JavaScript).

    Item In Apex In JavaScript
    Object used to store in-memory logging data LogEntryEvent__e object ComponentLogEntry inner class in logEntryBuilder.js
    Internal method used to access/update in-memory logging data Instance method LogEntryEventBuilder.getLogEntryEvent() Instance method LogEntryEventBuilder.getComponentLogEntry() in logEntryBuilder.js

Bugfixes

  • Small bugfix for logging in Flow: Added an extra guard clause in the private instance method LogEntryHandler.setFlowDefinitionFields() to prevent a possible NullPointerException. Previously, the code assumed that when OriginLocation__c == 'Flow', then OriginLocation__c would be the API name of the logging Flow. However, this may not always be the case, especially since the invocable actions currently rely on admins/devs to provide the Flow's API name, which is inherently an imperfect approach - but there isn't currently a way in Apex or Flow to automatically determine the Flow's API name, so the new guard clause helps avoid an exception.

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.5...v4.10.6

Added Custom Index for LogEntry__c.OriginLocation__c

31 May 22:09
8db89d0
Compare
Choose a tag to compare

Core Unlocked Package Changes

Added Custom Index for LogEntry__c.OriginLocation__c

  • Resolved #400 by adding a custom index for the field LogEntry__c.OriginLocation__c, using the new CustomIndex metadata type. This should help to improve queries & reports that filter on this field.
    • This release is intentionally very small - since CustomIndex is a relatively new metadata type (released last year), this is being released in isolation, just as a precaution. Based on testing of the index, there are not any issues anticipated with this change.

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.4...v4.10.5

Added Home Page & Dashboard to Console App

31 May 02:29
da3bbaa
Compare
Choose a tag to compare

⚠️ For orgs that are upgrading to this version & that use Logger Admin Dashboard plugin: You will need to uninstall the Logger Admin Dashboard plugin first before you can upgrade to the core package in your org. The metadata from the Logger Admin Dashboard plugin has been added to the core package, and the plugin is now deprecated.

Core Unlocked Package Changes

This release is focused on some related enhancements to help improve the usability & usefulness of the included lightning console app, including:

  • Streamline access to some of Nebula Logger's features (namely, some of the included custom LWCs)
  • Make it easier for admins & developers to find helpful resources for using/configuring Nebula Logger
  • Provide admins & developers with a pre-built dashboard (and more reports) within the core package

These enhancements have culminated in a new home page, available in the console app

image

Console app changes

  • Changed label of console app from "Logger Console" to "Nebula Logger". The API name of the app, LoggerConsole, is not changing - this is just a label change.

    image

  • Added new home page LoggerHomePage.flexipage-meta.xml to the console app (configured as the app's default home page). It includes:

    • A new custom header component, loggerHomeHeader, that provides quick access to information about the current environment & quick access to the latest release notes for Nebula Logger
      image

    • A tab set that includes 4 tabs:

      1. Dashboard: the first & default tab, this displays the new LoggerAdmin dashboard that is now included (previously, this dashboard was available as a separate plugin package)
      2. Settings: this displays the existing LWC loggerSettings, which was previously available via the custom tab "Logger Settings"
      3. Event Stream: this displays the existing LWC logEntryEventStream, which was previously available via the custom tab "Log Entry Event Stream"
      4. Batch Purge: this displays the existing LWC logBatchPurge, which was previously available via the custom tab "Log Batch Purge"
  • Removed several custom tabs from the console app's navigation menu. Since the new home page displays several custom LWCs, their corresponding customs tabs are no longer included in the console app's navigation

    image

    • ⚠For orgs that use the unlocked package & are upgrading: by default, you will still see the old navigation options. You can either leave them as-is, or you can reset the tabs to use the new defaults. To reset & see the new navigation options, open the console app:

      1. In the console's navigation dropdown menu, select the "Edit" option at the bottom
      2. In the modal that opens, select the "Reset Navigation to Default" option at the bottom and click "Save"

      image

Reports & Dashboard Changes

  • The core package now includes a dashboard out of the box, LoggerAdmin. The dashboard is based on 7 new reports that are also included:
    • LogEntryDailyRetentionSummary
    • LogEntryDailySummary
    • LogEntryDetails
    • LogEntryOriginSummary
    • LogEntryScenarioSummary
    • LogEntrySummary
    • LogEntryTagDetails

LWC Changes

  • logBatchPurge LWC

    • Updated the LWC's config to make isExposed = true and added the target lightning__HomePage so that the component can be added in App Builder to the new home page
    • Added a confirmation prompt to the "Run Batch Purge" button to help prevent accidentally starting the job
    • Moved the spinner to only overlay on the lightning-datatable (when refreshing the data), instead of the spinner overlaying the entire page
    • Cleaned up some various code bits in the HTML and JS files (mostly to make some function names & terminology more consistent)
  • logEntryEventStream LWC Enhancements

    • Updated the LWC's config to make isExposed = true and added the target lightning__HomePage so that the component can be added in App Builder to the new home page
    • Removed a line in connectedCallback() that was setting document.title
    • Minor CSS changes to improve the layout of the component within the home page's tab set
  • loggerSettings LWC Enhancements

    • Updated the LWC's config to make isExposed = true and added the target lightning__HomePage so that the component can be added in App Builder to the new home page
    • Removed a line in connectedCallback() that was setting document.title
  • loggerHomeHeader LWC - New!

    • Added new component that's used by the new home page. It provides a link to the current release's release notes, as well as a modal that provides environment details, using a combination of information from the Organization object and from making a callout to Salesforce's Status API, https://api.status.salesforce.com/v1/instances/.
      image

Backend Changes

  • Bugfix: fixed the instance method LogEntryEventBuilder.setExceptionDetails(System.Exception apexException) so it properly handles null values
  • Bugfix: fixed the instance method LogManagementDataSelector.getUsersByNameSearch(String searchTerm) to use LIMIT 20 so it doesn't hit a SOQL query limit in large orgs 😨
  • Added public method Logger.callStatusApi(), used to centralize some existing code that is used to retrieve additional orgs details from Salesforce's Status API, https://api.status.salesforce.com/v1/instances/. Note that this method is only intended to be used internally by Nebula Logger and could change in future releases.

Logger Admin Dashboard Plugin - Now Deprecated! ⚠️

The Logger Admin Dashboard plugin is now deprecated, and will need to be uninstalled prior to upgrading to v4.10.4. The same dashboard & reports are now included in the core package, with one change: the dashboard is no longer a dynamic dashboard (due to the org limit of 5 dynamic dashboards).

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.3...v4.10.4

New LoggerSettings__c Fields StartTime__c and EndTime__c

24 May 17:28
0ba55c3
Compare
Choose a tag to compare

Core Unlocked Package Changes

Added New LoggerSettings__c Fields StartTime__c and EndTime__c

This release provides admins & developers even more control over configuring Nebula Logger for different users by adding the ability to schedule & expire specific LoggerSettings__c records, using 2 new datetime fields: StartTime__c and EndTime__c.

Scenario Behavior
StartTime__c and EndTime__c are both null No change to existing behavior
StartTime__c is set, EndTime__c is null The LoggerSettings__c record is only used for the specified SetupOwnerId if StartTime__c <= System.now()
StartTime__c is null, EndTime__c is set The LoggerSettings__c record is only used for the specified SetupOwnerId if EndTime__c >= System.now()
StartTime__c and EndTime__c are both set The LoggerSettings__c record is only used for the specified SetupOwnerId if both StartTime__c <= System.now() and EndTime__c >= System.now()

The new fields have also been added to the "Logger Settings" custom tab (which displays the loggerSettings LWC)

  • They appear in the datatable, after the "Setup Location" and "Setup Owner" fields, as shown in the screenshot below:

    image

  • They appear in the modal used for creating & editing records, within the "General Settings" section. The fields "Enabled" and "Logging Level" have been moved to the beginning of the "Logger Engine Settings" section, as shown in the screenshot below:

    image

  • Also cleaned up some legacy code used for displaying the fields in the 'General Settings' section of the loggerSettings lwc - all fields are now controlled by loggerSettingsPageLayout.js, which makes maintenance/changes easier

Pipeline Changes

  • Updated the pwsh script used by the pipeline so it now automatically updates README.md to have the new the package version ID in the unlocked package's sfdx install command. Previously, this value was being manually updated for each release.

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.2...v4.10.3

Logger LWC Enhancements

22 May 19:11
695887d
Compare
Choose a tag to compare

Many thanks to @jefersonchaves for all of the work on this release! This release makes some changes and improvements to logging in lightning components, and provides support for logging in additional lifecycle events that would have previously failed to log.

⚠️ For orgs that are upgrading to this version & that use the logger LWC for logging in Aura/LWC: This release has 2 important changes:

  1. The behavior of the getUserSettings() to return a read-only object (in previous versions, this object was modifiable). This change will break any code that previously relied on getUserSettings() to change in-memory settings values. If this negatively impacts your code, please let me know!
  2. There is now a new recommended approach for using the logger LWC within your own components. Instead of adding <c-logger> directly in your HTML markup, you should now instead import it in your JavaScript file, using import { createLogger } from 'c/logger';
    • Note: the old approach of adding <c-logger> directly in your HTML markup is still supported (and I have no plans to remove the functionality) - but due to limitations with its approach (namely, it can't be used for logging in all lifecycle events), it is now considered deprecated & is no longer the recommended way to log in JavaScript.

Core Unlocked Package Changes

logger LWC Enhancements

  • @jefersonchaves resolved #280 and #483 via PR #401 - the logger LWC can now be used to log during all LWC lifecycle events and @wire properties/methods. Please note that this requires updating your own components to use import { createLogger } from 'c/logger';
    • Previously, you would have added <c-logger> to your markup and had something like this in your JavaScript file:
      import { LightningElement } from 'lwc';
      
      export default class SomeExampleComponent extends LightningElement {
          someFunction() {
              const logger = this.template.querySelector('c-logger');
              logger.info('hello, world');
              logger.saveLog();
          }
      }
    • Now, you can remove <c-logger> in your markup, and instead import it in your JavaScript file:
      import { LightningElement } from 'lwc';
      import { createLogger } from 'c/logger';
      
      export default class SomeExampleComponent extends LightningElement {
          logger = createLogger();
          
          someFunction() {
              this.logger.info('hello, world');
              this.logger.saveLog();
          }
      }
    • These lifecycle events have been tested and should work with the new import approach:
      • constructor()
      • connectedCallback()
      • disconnectedCallback()
      • renderedCallback()
      • @wire properties and methods
  • Improved the console statements that are generated by Nebula Logger when console logging is enabled via LoggerSettings__c. Now, each log entry created in JavaScript:
    • Includes Nebula Logger as a prefix for any output - this makes it to know which entries in your browser's console were generated by Nebula Logger

      image

    • Includes an additional (collapsed) output to provides more details for each entry, including the entry object itself and a JavaScript trace - these additional details can help with troubleshooting issues in your components and understanding which components generated specific entries

      image

Recipes Changes

  • Updated loggerLWCDemo lwc to use logger LWC's new createLogger function (instead of using <c-logger> in the markup) as the recommended approach for logging in JavaScript
  • Added loggerLWCLegacyDemo lwc to continue providing an example of using the now-deprecated (but still-supported) approach of using <c-logger> in markup

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.1...v4.10.2

Added the ability to save a subset of LogEntryEvent__e records, based on entry logging level

10 Apr 16:13
d090f6a
Compare
Choose a tag to compare

Core Unlocked Package Changes

New LoggerSettings__c Field DefaultPlatformEventStorageLoggingLevel__c

  • Reorganized all fields in the loggerSettings lwc to be grouped into 2 main sections: Logger Engine Settings and Log Management Settings (shown in the screenshot below)

  • Resolved #475 by adding a new settings field, LoggerSettings__c.DefaultPlatformEventStorageLoggingLevel__c - this field can be used to optionally control which LogEntryEvent__e records are saved in custom objects, based on their logging level. For example, in the screenshot below

    • The existing field LoggingLevel__c (red box) is configured with the value FINEST, so all LogEntryEvent__e records will be published through the EventBus

    • The new field DefaultPlatformEventStorageLoggingLevel__c (green box) is configured with the value INFO, so only entries with a logging level of ERROR, WARN, or INFO will be stored in the custom objects Log__c and LogEntry__c.

      image

Bugfixes

  • Fixed #478 by replacing an unnecessary query with a mock Network record - thanks to @rafahg for reporting this issue!

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.10.0...v4.10.1

v4.10.0 - Spring '23 Release

05 Apr 16:41
c9c4b5d
Compare
Choose a tag to compare

Managed Package Release - v4.10.0

Happy belated Spring '23 release! 🥳 A little behind schedule, this release is for both the unlocked package (as always), as well as the managed package! For orgs that are upgrading to this version of the managed package, you can see everything that's changed between v4.9.0 and v4.10.0 by reviewing:

  • The v4.10.0 milestone to see all of the issues & pull requests that are included in the this release.
  • The diff between v4.9.0 and v4.10.0 to see all of the code & metadata changes that have been committed since the last managed package release.

Core Unlocked Package Changes - v4.10.0

Metadata API Version

  • Updated all metadata from API v56.0 (Winter '23 release) to v57.0 (Spring '23 release)
  • Removed the now-deprecated picklist value "v56.0 - Winter '23 Release" in the field Log__c.ApiVersion__c, added "v58.0 - Summer '23 Release"

Apex Logging Improvements

  • @jamessimone added several new methods in PR #471 to add support for logging instances of Database.LeadConvertResult - thanks to @justin-lyon for pointing out that this was missing from the list of supported Database classes that were added in v4.7.4!
    • Added new instance method overload LogEntryEventBuilder.setDatabaseResult(Database.LeadConvertResult leadConvertResult)

    • Added several static method overloads in Logger for easily logging Database.LeadConvertResult instances. The full list of method overloads is:

      global static LogEntryEventBuilder error(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder error(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder warn(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder warn(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder info(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder info(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder debug(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder debug(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder fine(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder fine(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder finer(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder finer(String message, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder finest(LogMessage logMessage, Database.LeadConvertResult leadConvertResult);
      global static LogEntryEventBuilder finest(String message, Database.LeadConvertResult leadConvertResult);
    • Added static methods overloads for Logger.logDatabaseErrors() for logging List<Database.LeadConvertResult> errors. If the list of lead convert results includes 1 or more errors (based on isSuccess() == false), then a new log entry is added, and the JSON of any unsuccessful results is serialized/stored in the log entry.

      global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, LogMessage logMessage, List<Database.LeadConvertResult> leadConvertResults);
      global static LogEntryEventBuilder logDatabaseErrors(System.LoggingLevel loggingLevel, String message, List<Database.LeadConvertResult> leadConvertResults);

Bugfixes

  • Worked with @jamessimone to fix #436 that prevented data from being fully loaded in the "Open Viewer" quick action on Log__c - thanks to @solo-1234 for reporting this issue!
    • Small enhancement: added a lightning-spinner to logViewer that's displayed on load
  • Fixed #469 by updating how some tests query for the autoproc user - thanks to @YodaDaCoda for reporting this & providing the solution!

Code Cleanup

  • Bumped all metadata to API v57.0 (Summer '23 release)
  • Moved the private constant LogEntryEventBuilder.ORGANIZATION_API_VERSION to Logger.ORGANIZATION_API_VERSION so Logger can dynamically include the API version when saving with the save method Logger.SaveMethod.REST
  • Finally removed the last @future method in the codebase, LogEntryEventHandler.setStatusApiDetails() (used to call the Salesforce Status API), and replaced it with a private queueable class LogEntryEventHandler.StatusApiCalloutQueueable

Documentation Improvements

  • Added sfdx commands in README.md so everyone can easily copy & paste the recommended commands to install Nebula Logger's unlocked & managed core packages

Pipeline Changes

  • Updated sfdx to version 7.191.1
  • Updated sfdx commands in build.yml and package.json to use the new syntax for commands & parameters

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.9.11...v4.10.0

Core Managed Package - Nebula namespace

Full Changelog: v4.9.0...v4.10.0