Releases: jongpie/NebulaLogger
Lightning component logging support
You can now add log entries from your custom Lightning components!
- Added logger.cmp Lightning component - this can be embedded in your own Lightning components to enable logging.
Example custom component that uses logger.cmp
<aura:component>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<!-- Embed the custom logger component -->
<c:logger aura:id="logger" />
</aura:component>
Example component controller
({
doInit : function(component, event, helper) {
var logger = component.find('logger');
logger.addDebugEntry(component, 'INFO', 'My LEX message', 'loggerDemo.doInit function', ['LEX-CMP']);
logger.save();
}
})
Trello Integration
Exception Logs can now be pushed to Trello!
- Added new record
Trello
in custom metadata typeLoggerIntegration__mdt
to store auth details TrelloLogPusher
class: handles pushing any LogEntry__c records to Slack where Log__c.PushToTrello__c = trueTrelloLogPushScheduler
class: handles scheduling jobs for pushing logs to Trello. There are 3 static methods to make scheduling easier- scheduleEveryXMinutes(Integer x)
- scheduleHourly(Integer startingMinuteInHour)
- scheduleHourly(Integer startingMinuteInHour, String jobName)
Slack Integration
Logs can now be pushed to Slack!
- Slack notifications are automatically colored red when a log contains 1 or more exceptions (otherwise, they're colored green)
- Added new record 'Slack' in custom metadata type
LoggerIntegration__mdt
to store auth details SlackLogPusher
class: handles pushing any LogEntry__c records to Slack where Log__c.PushToSlack__c = trueSlackLogPushScheduler
class: handles scheduling jobs for pushing logs to Slack. There are 3 static methods to make scheduling easier- scheduleEveryXMinutes(Integer x)
- scheduleHourly(Integer startingMinuteInHour)
- scheduleHourly(Integer startingMinuteInHour, String jobName)
Chatter Topics support & Loggly integration
Redesigned Logger public methods to support Chatter Topics & to reduce the number of parameters.
Adding Entries
There are 6 methods for adding log entries
- addDebugEntry(String message, String originLocation)
- addDebugEntry(LoggingLevel loggingLevel, String message, String originLocation)
- addDebugEntry(LoggingLevel loggingLevel, String message, String originLocation, List topics)
- addExceptionEntry(Exception ex, String originLocation)
- addExceptionEntry(Exception ex, String originLocation, List topics)
- Invocable Method: addFlowEntries(List flowLogEntries)
Context & Limits Automatically Captured
Log__c
& LogEntry__c
objects have new fields to capture context & limits data, including
1. If the log entry was captured via a trigger and/or Visualforce page, along with SObject type & Visualforce page name
2. The stats of all platform limits available via the Limits class at the time that the log entry was captured
3. Stats about what them the user is using (Classic, Lightning Experience, Mobile App, etc)
Added Loggly Integration
- Added new custom metadata type
LoggerIntegration__mdt
to store auth details for integrations, starting with Loggly LogglyLogPusher
class: handles pushing any LogEntry__c records to Loggly where Log__c.PushToLoggly__c = trueLogglyLogPushScheduler
class: handles scheduling jobs for pushing logs to Loggly. There are 3 static methods to make scheduling easier- scheduleEveryXMinutes(Integer x)
- scheduleHourly(Integer startingMinuteInHour)
- scheduleHourly(Integer startingMinuteInHour, String jobName)
Initial Beta Release
Designed for Salesforce admins & developers. Supports logging for Apex, Process Builder & Flow
- Apex can use
Logger.addDebugEntry()
,Logger.addExceptionEntry()
andLogger.saveLog()
- Process Builder/Flow can call the invocable Apex methods
FlowLogEntry.addFlowEntries()
andLogger.saveLog()
Features
A robust logger for Salesforce that's simple to implement & configurable at the org, profile & user level.
- Generates 1 log per transaction
- Supports adding log entries via Apex, Process Builder & Flow
- Supports adding both debug & exception log entries to the log - logs can still be saved even if an exception is thrown
- Supports adding log entries as debug statements in Salesforce's Debug Log
- Supports specifying a logging level for each log entry
- Allows logging to be enabled/disabled for different users & profiles
- Allows logging level to be configured for each user/profile
- Allows different debug & exception log entries to be disabled/ignored without making code changes