### Quick Start Example: Logging INFO and ERROR Entries Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger This example demonstrates how to add an INFO log entry with a message and an ERROR log entry with an Apex exception, then save them using the CallableLogger. It first checks for the availability of Nebula Logger. ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerCallable = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerCallable == null) { return; } // Example action: Add a basic "hello, world!" INFO entry Map infoEntryInput = new Map{ 'loggingLevel' => System.LoggingLevel.INFO, 'message' => 'hello, world!' }; nebulaLoggerCallable.call('newEntry', infoEntryInput); // Example action: Add an ERROR entry with an Apex exception Exception someException = new DmlException('oops'); Map errorEntryInput = new Map{ 'exception' => someException, 'loggingLevel' => LoggingLevel.ERROR, 'message' => 'An unexpected exception was thrown' }; nebulaLoggerCallable.call('newEntry', errorEntryInput); // Example: Save any pending log entries nebulaLoggerCallable.call('saveLog', null); ``` -------------------------------- ### searchForSetupOwner(String setupOwnerType, String searchTerm) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Log-Management/LoggerSettingsController.md Searches for setup owners (Profiles or Users) based on a search term. ```APIDOC ## searchForSetupOwner(String setupOwnerType, String searchTerm) ### Description searchForSetupOwner description. ### Method APEX ### Parameters #### Path Parameters - **setupOwnerType** (String) - Required - The object to search (`Schema.Profile` or `Schema.User`) - **searchTerm** (String) - Required - The search term to use when searching records ### Return **Type** List **Description** The list of `SetupOwnerSearchResult`, based on any matching SObject records ``` -------------------------------- ### Example Apex Plugin Implementation Source: https://github.com/jongpie/nebulalogger/wiki/Plugin-Framework Implement the `LoggerPlugin.Triggerable` interface to create an Apex plugin. This example shows how to filter by SObject type and modify records before insertion. ```apex public class ExampleTriggerablePlugin implements LoggerPlugin.Triggerable { public void execute(LoggerPlugin__mdt configuration, LoggerTriggerableContext input) { // Example: only run the plugin for Log__c records if (context.sobjectType != Schema.Log__c.SObjectType) { return; } List logs = (List) input.triggerNew; switch on input.triggerOperationType { when BEFORE_INSERT { for (Log__c log : logs) { log.Status__c = 'On Hold'; } } when BEFORE_UPDATE { // TODO add before-update logic } } } } ``` -------------------------------- ### start(Database.BatchableContext batchableContext) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Log-Management/LogBatchPurger.md Required by the Database.Batchable interface. Collects the records / objects passed in to the batch instance and returns a Database.QueryLocator reference representing the current iteration. ```APIDOC ## start(Database.BatchableContext batchableContext) ### Description Required by the Database.Batchable interface. Collects the records / objects passed in to the batch instance and returns a Database.QueryLocator reference representing the current iteration. ### Parameters #### Path Parameters - **batchableContext** (Database.BatchableContext) - Required - contains the context of the batch job ### Return **Type** Database.QueryLocator **Description** an instance of the Database.QueryLocator class ### Throws **Exception** NoAccessException **Description** when there is no delete access to Logs ``` -------------------------------- ### saveLog Action Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger This example shows how to call the 'saveLog' action. This action can be called with no arguments (passing null for args) or with optional arguments like 'saveMethodName'. ```APIDOC ## saveLog ### Description Saves the log entries. This action can be invoked with no required inputs, or with optional parameters to customize the save method. ### Method call ### Parameters #### Arguments Map (`args`) - **saveMethodName** (String) - Optional - Specifies the method to use for saving logs (e.g., 'SYNCHRONOUS_DML'). ### Request Example ```apex // Dynamically create a instance Nebula Logger's Callable Apex class (if it's available) Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerInstance = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerInstance == null) { return; } // Example: ✅ Save logs, using default settings (no input required) nebulaLoggerInstance.call('saveLog', null); // Example: ℹ️ Save logs, using some optional settings Map saveLogInput = new Map{ 'saveMethodName' => 'SYNCHRONOUS_DML' }; nebulaLoggerInstance.call('saveLog', saveLogInput); ``` ### Response #### Success Response (200) - **isSuccess** (Boolean) - Indicates if the operation was successful. - **transactionId** (String) - The current transaction ID. - **parentLogTransactionId** (String) - The parent log transaction ID (or null). - **requestId** (String) - The Salesforce-generated request ID. #### Response Example ```json { "isSuccess": true, "transactionId": "someTransactionId", "parentLogTransactionId": null, "requestId": "someRequestId" } ``` ``` -------------------------------- ### Example Apex Plugin for NebulaLogger Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Implement the LoggerPlugin.Triggerable interface to create custom automation for Log__c or LogEntry__c objects. This example shows how to set the status for Log__c records during a BEFORE_INSERT operation. ```apex public class ExampleTriggerablePlugin implements LoggerPlugin.Triggerable { public void execute(LoggerPlugin__mdt configuration, LoggerTriggerableContext input) { // Example: only run the plugin for Log__c records if (context.sobjectType != Schema.Log__c.SObjectType) { return; } List logs = (List) input.triggerNew; switch on input.triggerOperationType { when BEFORE_INSERT { for (Log__c log : logs) { log.Status__c = 'On Hold'; } } when BEFORE_UPDATE { // TODO add before-update logic } } } } ``` -------------------------------- ### LWC Usage Example Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Demonstrates how to import and use the logger in an LWC component. Initialize the logger once per component and call logging methods as needed. Supports various logging levels and adding tags. ```javascript // For LWC, import logger's createLogger() function into your component import { getLogger } from 'c/logger'; import callSomeApexMethod from '@salesforce/apex/LoggerLWCDemoController.callSomeApexMethod'; export default class LoggerDemo extends LightningElement { // Call getLogger() once per component logger = getLogger(); async connectedCallback() { this.logger.setScenario('some scenario'); this.logger.finer('initialized demo LWC, using async connectedCallback'); } @wire(callSomeApexMethod) wiredCallSomeApexMethod({ error, data }) { this.logger.info('logging inside a wire function'); if (data) { this.logger.info('wire function return value: ' + data); } if (error) { this.logger.error('wire function error: ' + JSON.stringify(error)); } } logSomeStuff() { this.logger.error('Add log entry using Nebula Logger with logging level == ERROR').addTag('some important tag'); this.logger.warn('Add log entry using Nebula Logger with logging level == WARN'); this.logger.info('Add log entry using Nebula Logger with logging level == INFO'); this.logger.debug('Add log entry using Nebula Logger with logging level == DEBUG'); this.logger.fine('Add log entry using Nebula Logger with logging level == FINE'); this.logger.finer('Add log entry using Nebula Logger with logging level == FINER'); this.logger.finest('Add log entry using Nebula Logger with logging level == FINEST'); this.logger.saveLog(); } doSomething(event) { this.logger.finest('Starting doSomething() with event: ' + JSON.stringify(event)); try { this.logger.debug('TODO - finishing implementation of doSomething()').addTag('another tag'); // TODO add the function's implementation below } catch (thrownError) { this.logger .error('An unexpected error log entry using Nebula Logger with logging level == ERROR') .setExceptionDetails(thrownError) .addTag('some important tag'); } finally { this.logger.saveLog(); } } } ``` -------------------------------- ### start(LoggerPlugin_t configuration, LoggerBatchableContext input) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Plugins/LogEntryArchivePlugin.md Skips deleting LogEntryTag__c records to include tags when LogEntry__c records are archived. ```APIDOC ## start(LoggerPlugin_t configuration, LoggerBatchableContext input) ### Description Skips directly deleting `LogEntryTag__c` records in `LogBatchPurger` so that the tags can be included when `LogEntry__c` records are archived into `LogEntryArchive__b`. ### Parameters #### Path Parameters - `configuration` (LoggerPlugin_t) - The instance of `LoggerPlugin_t` configured for this specific plugin - `input` (LoggerBatchableContext) - The instance of `LoggerBatchableContext`, provided by the logging system ``` -------------------------------- ### newEntry Action Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger This example demonstrates how to call the 'newEntry' action to log a message with a specified logging level. It requires an 'args' map containing 'loggingLevel' and 'message'. ```APIDOC ## newEntry ### Description Logs a new entry with a specified logging level and message. ### Method call ### Parameters #### Arguments Map (`args`) - **loggingLevel** (System.LoggingLevel) - Required - The logging level for the entry. - **message** (String) - Required - The log message content. ### Request Example ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerCallable = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerCallable == null) { return; } Map infoEntryInput = new Map{ 'loggingLevel' => System.LoggingLevel.INFO, 'message' => 'hello, world!' }; nebulaLoggerCallable.call('newEntry', infoEntryInput); ``` ### Response #### Success Response (200) - **isSuccess** (Boolean) - Indicates if the operation was successful. - **transactionId** (String) - The current transaction ID. - **parentLogTransactionId** (String) - The parent log transaction ID (or null). - **requestId** (String) - The Salesforce-generated request ID. #### Response Example ```json { "isSuccess": true, "transactionId": "someTransactionId", "parentLogTransactionId": null, "requestId": "someRequestId" } ``` ``` -------------------------------- ### Nebula Logger Apex Logging Examples Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Demonstrates how to create log entries with different severity levels using the Nebula Logger Apex class. The `saveLog()` method persists these entries as `Log__c` and `LogEntry__c` records. ```apex // This will create a new `Log__c` record with multiple related `LogEntry__c` records Logger.error('Add log entry using Nebula Logger with logging level == ERROR'); Logger.warn('Add log entry using Nebula Logger with logging level == WARN'); Logger.info('Add log entry using Nebula Logger with logging level == INFO'); Logger.debug('Add log entry using Nebula Logger with logging level == DEBUG'); Logger.fine('Add log entry using Nebula Logger with logging level == FINE'); Logger.finer('Add log entry using Nebula Logger with logging level == FINER'); Logger.finest('Add log entry using Nebula Logger with logging level == FINEST'); Logger.saveLog(); ``` -------------------------------- ### Install Unlocked Package Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Use this command to install the Unlocked Package version of Nebula Logger in your Salesforce environment. The `--wait` flag specifies how long to wait for the installation to complete. ```bash sf package install --wait 20 --security-type AdminsOnly --package 04tg70000009GaDAAU ``` -------------------------------- ### Apex Logger Debug Examples Source: https://github.com/jongpie/nebulalogger/wiki/Logging-in-Apex Demonstrates three ways to log a debug message with an SObject: using static overloads, an instance of LogEntryEventBuilder, and chaining builder methods. Ensure the User object is queried before logging. ```apex // Get the current user so we can log it (just as an example of logging an SObject) User currentUser = [SELECT Id, Name, Username, Email FROM User WHERE Id = :UserInfo.getUserId()]; // Using static Logger method overloads Logger.debug('my string', currentUser); // Using the instance of LogEntryEventBuilder LogEntryEventBuilder builder = Logger.debug('my string'); builder.setRecord(currentUser); // Chaining builder methods together Logger.debug('my string').setRecord(currentUser); // Save all of the log entries Logger.saveLog(); ``` -------------------------------- ### Install Managed Package Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Use this command to install the Managed Package version of Nebula Logger in your Salesforce environment. The `--wait` flag specifies how long to wait for the installation to complete. ```bash sf package install --wait 30 --security-type AdminsOnly --package 04tg700000086RdAAI ``` -------------------------------- ### General Call Syntax and Output Handling Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger This section provides a general overview of how to call any action using the `Callable` interface and how to interpret the output, including success and error scenarios. ```APIDOC ## General Call and Output Handling ### Description All actions exposed via the `Callable` interface expect an `args` map (or `null` if no arguments are needed) and return a `Map`. ### Method `Object call(String action, Map args)` ### Parameters #### Arguments Map (`args`) - **action** (String) - Required - The name of the action to perform. - **args** (Map) - Optional - A map of parameters required by the specific action. Can be `null` if the action requires no input. ### Response #### Success Response (200) - **isSuccess** (Boolean) - `true` if the operation completed successfully. - **transactionId** (String) - The current transaction ID. - **parentLogTransactionId** (String) - The parent log transaction ID (or `null`). - **requestId** (String) - The Salesforce-generated request ID. #### Error Response (Catchable Exception) - **isSuccess** (Boolean) - `false` if an error occurred. - **exceptionMessage** (String) - The message from the caught exception. - **exceptionStackTrace** (String) - The stack trace of the caught exception. - **exceptionType** (String) - The type name of the caught exception. - **transactionId** (String) - The current transaction ID. - **parentLogTransactionId** (String) - The parent log transaction ID (or `null`). - **requestId** (String) - The Salesforce-generated request ID. ### Request Example ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerInstance = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerInstance == null) { return; } // Example of calling an action and checking the result Map output = (Map) nebulaLoggerInstance.call('saveLog', null); System.debug('Log entries were successfully saved: ' + output.get('isSuccess')); System.debug('Exception Type: ' + output.get('exceptionType')); System.debug('Exception Message: ' + output.get('exceptionMessage')); System.debug('Exception Stack Trace: ' + output.get('exceptionStackTrace')); ``` ``` -------------------------------- ### Using Logger Methods and Fluent Interface Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Demonstrates different ways to create and customize log entries using Logger methods and the LogEntryEventBuilder. All approaches result in identical log entries. ```apex // Get the current user so we can log it (just as an example of logging an SObject) User currentUser = [SELECT Id, Name, Username, Email FROM User WHERE Id = :UserInfo.getUserId()]; // Using static Logger method overloads Logger.debug('my string', currentUser); // Using the instance of LogEntryEventBuilder LogEntryEventBuilder builder = Logger.debug('my string'); builder.setRecord(currentUser); // Chaining builder methods together Logger.debug('my string').setRecord(currentUser); // Save all of the log entries Logger.saveLog(); ``` -------------------------------- ### getInstance Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Log-Management/LogManagementDataSelector.md Gets the singleton instance of the LogManagementDataSelector. ```APIDOC ## getInstance() ### Description Returns the singleton instance of `LogManagementDataSelector` used for querying the log management layer. ### Return #### Success Response - **Type**: LogManagementDataSelector - **Description**: The singleton instance of `LogManagementDataSelector`. ``` -------------------------------- ### getAll() Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Configuration/LoggerScenarioRule.md Retrieves all enabled LoggerScenarioRule_t records that have valid start and end times. Null times are considered valid. ```APIDOC ## getAll() ### Description Returns a map containing any enabled `LoggerScenarioRule_t` records with valid `StartTime__c` and `EndTime__c` values (null is considered valid). ### Return **Type** Map<String, LoggerScenarioRule_t> **Description** The current transaction's cached `Map<String, LoggerScenarioRule_t>`, where the key ``` -------------------------------- ### Basic Logging Levels in Apex Source: https://github.com/jongpie/nebulalogger/wiki/Logging-in-Apex Demonstrates how to log messages using different severity levels with the Nebula Logger. Includes a native Apex debug statement for comparison. ```java System.debug('Debug statement using native Apex'); ``` ```java Logger.error('Add log entry using Nebula Logger with logging level == ERROR'); ``` ```java Logger.warn('Add log entry using Nebula Logger with logging level == WARN'); ``` ```java Logger.info('Add log entry using Nebula Logger with logging level == INFO'); ``` ```java Logger.debug('Add log entry using Nebula Logger with logging level == DEBUG'); ``` ```java Logger.fine('Add log entry using Nebula Logger with logging level == FINE'); ``` ```java Logger.finer('Add log entry using Nebula Logger with logging level == FINER'); ``` ```java Logger.finest('Add log entry using Nebula Logger with logging level == FINEST'); ``` ```java Logger.saveLog(); ``` -------------------------------- ### Create and Call newEntry Action Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger Use this snippet to create an INFO log entry with a message. It demonstrates passing required input parameters for the 'newEntry' action. ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerCallable = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerCallable == null) { return; } // Example: Add a basic "hello, world!" INFO entry Map infoEntryInput = new Map{ 'loggingLevel' => System.LoggingLevel.INFO, 'message' => 'hello, world!' }; nebulaLoggerCallable.call('newEntry', infoEntryInput); ``` -------------------------------- ### Get Scenario with Nebula Logger Callable Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger Retrieve the current scenario name by invoking the 'getScenario' action on a CallableLogger instance. The scenario is returned in the output map under the 'scenario' key. ```apex Callable nebulaLoggerCallable = (Callable) Type.forName('CallableLogger')?.newInstance(); Map output = (Map) nebulaLoggerCallable?.call('getScenario', null); System.debug('Current scenario: ' + (String) output.get('scenario')); ``` -------------------------------- ### Aura Component Logger Integration Source: https://github.com/jongpie/nebulalogger/blob/main/README.md Retrieve the logger instance from your Aura component's markup to access logging methods. This example demonstrates various logging levels and saving the log. ```javascript const logger = component.find('logger'); logger.error('Hello, world!').addTag('some important tag'); logger.warn('Hello, world!'); logger.info('Hello, world!'); logger.debug('Hello, world!'); logger.fine('Hello, world!'); logger.finer('Hello, world!'); logger.finest('Hello, world!'); logger.saveLog(); ``` -------------------------------- ### Get Transaction ID with Nebula Logger Callable Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger Retrieve the current transaction ID by instantiating CallableLogger and calling the 'getTransactionId' action. The transaction ID is returned in the output map under the 'transactionId' key. ```apex Callable nebulaLoggerCallable = (Callable) Type.forName('CallableLogger')?.newInstance(); Map output = (Map) nebulaLoggerCallable?.call('getTransactionId', null); System.debug('Current transaction ID: ' + (String) output.get('transactionId')); ``` -------------------------------- ### setupMockSObjectHandlerConfigurations() Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Test-Utilities/LoggerTestConfigurator.md Creates mock instances of LoggerSObjectHandler_t for each SObjectType used by Nebula Logger, with IsEnabled__c set to true on each LoggerSObjectHandler_t record. ```APIDOC ## setupMockSObjectHandlerConfigurations() ### Description Creates mock instances of `LoggerSObjectHandler_t` for each `SObjectType` used by Nebula Logger, with `IsEnabled__c` set to `true` on each `LoggerSObjectHandler_t` record. ### Method `void` ### Parameters None ``` -------------------------------- ### Get Parent Log Transaction ID with Nebula Logger Callable Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger Fetch the parent log transaction ID by calling the 'getParentLogTransactionId' action on an instance of CallableLogger. The result is available in the output map as 'parentLogTransactionId'. ```apex Callable nebulaLoggerCallable = (Callable) Type.forName('CallableLogger')?.newInstance(); Map output = (Map) nebulaLoggerCallable?.call('getParentLogTransactionId', null); System.debug('Current parent log transaction ID: ' + (String) output.get('parentLogTransactionId')); ``` -------------------------------- ### info(LogMessage logMessage, List leadConvertResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO, using a LogMessage and a list of Database.LeadConvertResults. Returns a LogEntryEventBuilder for chaining. ```APIDOC ## info(LogMessage logMessage, List leadConvertResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - `logMessage` (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field. - `leadConvertResults` (List) - Required - The instance of `List` to log. ### Return #### Success Response - **Type**: LogEntryEventBuilder - **Description**: The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods. ``` -------------------------------- ### Call saveLog Action with Optional Input Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger Demonstrates calling the 'saveLog' action with optional parameters, such as specifying the save method. This shows how to provide specific configurations when saving logs. ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerInstance = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerInstance == null) { return; } // Example: ℹ️ Save logs, using some optional settings Map saveLogInput = new Map{ 'saveMethodName' => 'SYNCHRONOUS_DML' }; nebulaLoggerInstance.call('saveLog', saveLogInput); ``` -------------------------------- ### info(String message, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO. This overload accepts a list of Database.EmptyRecycleBinResult instances. ```APIDOC ## info(String message, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **emptyRecycleBinResults** (List) - Required - The instance of `List` to log ### Return #### Success Response - **Type**: LogEntryEventBuilder - **Description**: The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### Check Action Call Result Source: https://github.com/jongpie/nebulalogger/wiki/Dynamically-Call-Nebula-Logger This example shows how to inspect the output of a Nebula Logger action call. It demonstrates casting the result to a Map and checking the 'isSuccess' flag, along with retrieving error details if the call failed. ```apex Type nebulaLoggerCallableType = Type.forName('Nebula', 'CallableLogger') ?? Type.forName('CallableLogger'); Callable nebulaLoggerInstance = (Callable) nebulaLoggerCallableType?.newInstance(); if (nebulaLoggerInstance == null) { return; } // An example of checking the result of the action call Map output = (Map) nebulaLoggerCallable.call('saveLog', null); System.debug('Log entries were successfully saved in Nebula Logger: ' + output.get('isSuccess')); System.debug('Save exception type: ' + output.get('exceptionMessage')); System.debug('Save exception message: ' + output.get('exceptionType')); System.debug('Save exception stack trace: ' + output.get('exceptionStackTrace')); ``` -------------------------------- ### info(LogMessage logMessage, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO, using a LogMessage and a list of Database.EmptyRecycleBinResults. Returns a LogEntryEventBuilder for chaining. ```APIDOC ## info(LogMessage logMessage, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - `logMessage` (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field. - `emptyRecycleBinResults` (List) - Required - The instance of `List` to log. ### Return #### Success Response - **Type**: LogEntryEventBuilder - **Description**: The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods. ``` -------------------------------- ### Data Masking Example in Apex Source: https://github.com/jongpie/nebulalogger/wiki/Configuring-Data-Mask-Rules This Apex script demonstrates how to log messages containing sensitive data, such as credit card numbers and social security numbers. When data mask rules are enabled, this sensitive information will be automatically masked in the log entries. ```java Logger.error('Here is my fake Visa credit card 4000-1111-2222-0004, please don\'t steal it').addTag('data masking rule').addTag('credit card masking'); Logger.warn('Here is my fake Mastercard credit card 5000-1111-2222-0005, please don\'t steal it').addTag('data masking rule').addTag('credit card masking'); Logger.info('In case you want to steal my identity, my fake social is 400-11-9999, thanks', currentUser).addTag('data masking rule').addTag('an informational tag'); Logger.saveLog(); ``` -------------------------------- ### getSettings() Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/ComponentLogger.md Provides data to the frontend about LoggerSettings__c and server-supported logging details. ```APIDOC ## getSettings() ### Description Provides data to the frontend about `LoggerSettings__c` & server-supported logging details. ### Method GET (assumed, as it retrieves data) ### Endpoint /ComponentLogger/getSettings ### Return #### Success Response (200) - **Type**: ComponentLoggerSettings - **Description**: The instance of `ComponentLoggerSettings` for the current user. ### Response Example ```json { "defaultSaveMethodName": "Database", "isConsoleLoggingEnabled": true, "isEnabled": true, "isLightningLoggerEnabled": false, "supportedLoggingLevels": { "DEBUG": 0, "INFO": 1, "WARN": 2, "ERROR": 3 }, "userLoggingLevel": "INFO" } ``` ``` -------------------------------- ### fine(LogMessage logMessage, List leadConvertResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.FINE. This overload is used when logging a list of LeadConvertResults. ```APIDOC ## fine(LogMessage logMessage, List leadConvertResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINE`. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **logMessage** (LogMessage) - Description: The instance of `LogMessage` to use to set the entry's message field. - **leadConvertResults** (List) - Description: The instance of `List` to log. ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### warn(LogMessage logMessage, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.WARN. This overload accepts a LogMessage and a List of Database.EmptyRecycleBinResult. ```APIDOC ## warn(LogMessage logMessage, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.WARN`. ### Parameters #### Path Parameters - **logMessage** (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field - **emptyRecycleBinResults** (List) - Required - The instance of `List` to log ### Return #### Success Response (200) - **LogEntryEventBuilder** (LogEntryEventBuilder) - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### info(String message, List leadConvertResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO. This overload accepts a list of Database.LeadConvertResult instances. ```APIDOC ## info(String message, List leadConvertResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **leadConvertResults** (List) - Required - The instance of `List` to log ### Return #### Success Response - **Type**: LogEntryEventBuilder - **Description**: The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### Build Prism Static Resources Source: https://github.com/jongpie/nebulalogger/blob/main/nebula-logger/core/main/log-management/staticresources/LoggerResources/Prism/README.md Run this command to upgrade Prism.js to its latest version and regenerate the static resource files. This command should be run whenever Prism is upgraded or the build configuration is changed. Commit all four generated files after execution. ```bash npm run prism:build ``` -------------------------------- ### fine(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level FINE. Accepts a string message and a Database.EmptyRecycleBinResult. ```APIDOC ## fine(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINE`. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **message** (String) - The string to use to set the entry's message field - **emptyRecycleBinResult** (Database.EmptyRecycleBinResult) - The instance of `Database.EmptyRecycleBinResult` to log ### Request Example ```json { "message": "Example message", "emptyRecycleBinResult": { "success": true, "errors": [] } } ``` ### Response #### Success Response (200) - **LogEntryEventBuilder** (LogEntryEventBuilder) - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods #### Response Example ```json { "message": "Log entry created successfully." } ``` ``` -------------------------------- ### info(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO. This overload accepts a Database.EmptyRecycleBinResult. ```APIDOC ## info(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **emptyRecycleBinResult** (Database.EmptyRecycleBinResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return #### Success Response - **LogEntryEventBuilder** - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### fine(String message, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level FINE and associates it with a list of EmptyRecycleBinResults. ```APIDOC ## fine(String message, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == System.LoggingLevel.FINE. This method is useful for logging the outcome of emptying the recycle bin for multiple records. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **message** (String) - Required - The string to use to set the entry's message field. - **emptyRecycleBinResults** (List) - Required - The list of Database.EmptyRecycleBinResult instances to log. ### Request Example ```json { "message": "Recycle bin emptied successfully", "emptyRecycleBinResults": [ { ... }, { ... } ] } ``` ### Response #### Success Response (200) - **LogEntryEventBuilder** (LogEntryEventBuilder) - The new entry's instance of LogEntryEventBuilder, useful for chaining methods. #### Response Example ```json { "logEntryEventBuilder": { ... } } ``` ``` -------------------------------- ### finer(String message, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.FINER. Accepts a message and a list of Database.EmptyRecycleBinResult instances. ```APIDOC ## finer(String message, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINER`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **emptyRecycleBinResults** (List) - Required - The instance of `List` to log ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### warn (with EmptyRecycleBinResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level WARN, including details from a Database.EmptyRecycleBinResult. ```APIDOC ## warn(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult) ### Description Creates a new log entry with logging level `System.LoggingLevel.WARN`, including details from a `Database.EmptyRecycleBinResult`. ### Parameters #### Path Parameters - `logMessage` (LogMessage) - The instance of `LogMessage` to use to set the entry's message field. - `emptyRecycleBinResult` (Database.EmptyRecycleBinResult) - The instance of `Database.EmptyRecycleBinResult` to log. ### Return #### Success Response **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods. ``` -------------------------------- ### fine(String message, List leadConvertResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level set to `System.LoggingLevel.FINE`. This overload accepts a message and a list of `Database.LeadConvertResult` instances. It returns a `LogEntryEventBuilder` for method chaining. ```APIDOC ## fine(String message, List leadConvertResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINE`. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **message** (String) - Required - The string to use to set the entry's message field - **leadConvertResults** (List) - Required - The instance of `List` to log ### Request Example ```json { "message": "Example message", "leadConvertResults": [ // ... Database.LeadConvertResult instances ] } ``` ### Response #### Success Response (200) - **LogEntryEventBuilder** - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ### Response Example ```json { "example": "LogEntryEventBuilder instance" } ``` ``` -------------------------------- ### finer(String message, List leadConvertResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.FINER. Accepts a message and a list of Database.LeadConvertResult instances. ```APIDOC ## finer(String message, List leadConvertResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINER`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **leadConvertResults** (List) - Required - The instance of `List` to log ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### info(LogMessage logMessage, Database.LeadConvertResult leadConvertResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level set to System.LoggingLevel.INFO. ```APIDOC ## info(LogMessage logMessage, Database.LeadConvertResult leadConvertResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **logMessage** (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field - **leadConvertResult** (Database.LeadConvertResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### info(String message, Database.LeadConvertResult leadConvertResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO. This overload accepts a Database.LeadConvertResult. ```APIDOC ## info(String message, Database.LeadConvertResult leadConvertResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **leadConvertResult** (Database.LeadConvertResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return #### Success Response - **LogEntryEventBuilder** - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### warn(LogMessage logMessage, Database.LeadConvertResult leadConvertResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.WARN. This overload accepts a LogMessage and a Database.LeadConvertResult. ```APIDOC ## warn(LogMessage logMessage, Database.LeadConvertResult leadConvertResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.WARN`. ### Parameters #### Path Parameters - **logMessage** (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field - **leadConvertResult** (Database.LeadConvertResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return #### Success Response (200) - **LogEntryEventBuilder** (LogEntryEventBuilder) - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### info(LogMessage logMessage, List mergeResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO, using a LogMessage and a list of Database.MergeResults. Returns a LogEntryEventBuilder for chaining. ```APIDOC ## info(LogMessage logMessage, List mergeResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - `logMessage` (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field. - `mergeResults` (List) - Required - The instance of `List` to log. ### Return #### Success Response - **Type**: LogEntryEventBuilder - **Description**: The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods. ``` -------------------------------- ### execute() Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/LoggerSObjectHandler.md Runs the handler class's logic, as well as any configured plugins. ```APIDOC ## execute() ### Description Runs the handler class's logic, as well as any configured plugins. ### Method `execute()` ``` -------------------------------- ### info(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level set to System.LoggingLevel.INFO. ```APIDOC ## info(LogMessage logMessage, Database.EmptyRecycleBinResult emptyRecycleBinResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.INFO`. ### Parameters #### Path Parameters - **logMessage** (LogMessage) - Required - The instance of `LogMessage` to use to set the entry's message field - **emptyRecycleBinResult** (Database.EmptyRecycleBinResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### fine(LogMessage logMessage, List emptyRecycleBinResults) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level == System.LoggingLevel.FINE. This overload is used when logging a list of EmptyRecycleBinResults. ```APIDOC ## fine(LogMessage logMessage, List emptyRecycleBinResults) ### Description Creates a new log entry with logging level == `System.LoggingLevel.FINE`. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **logMessage** (LogMessage) - Description: The instance of `LogMessage` to use to set the entry's message field. - **emptyRecycleBinResults** (List) - Description: The instance of `List` to log. ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### warn(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level WARN, accepting a Database.EmptyRecycleBinResult. ```APIDOC ## warn(String message, Database.EmptyRecycleBinResult emptyRecycleBinResult) ### Description Creates a new log entry with logging level == `System.LoggingLevel.WARN`. ### Parameters #### Path Parameters - **message** (String) - Required - The string to use to set the entry's message field - **emptyRecycleBinResult** (Database.EmptyRecycleBinResult) - Required - The instance of `Database.LeadConvertResult` to log ### Return #### Success Response (200) - **LogEntryEventBuilder** - The new entry's instance of `LogEntryEventBuilder`, useful for chaining methods ``` -------------------------------- ### info(LogMessage logMessage, List records) Source: https://github.com/jongpie/nebulalogger/blob/main/docs/apex/Logger-Engine/Logger.md Creates a new log entry with logging level INFO. This overload accepts a list of SObject records. ```APIDOC ## info(LogMessage logMessage, List records) ### Description Creates a new log entry with logging level == System.LoggingLevel.INFO. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method This is a method signature, not an HTTP endpoint. ### Endpoint N/A ### Parameters #### Parameters - **logMessage** (LogMessage) - Required - The instance of LogMessage to use to set the entry's message field. - **records** (List) - Required - The list of SObject records to log. ### Return **Type** LogEntryEventBuilder **Description** The new entry's instance of LogEntryEventBuilder, useful for chaining methods. ```