New Release v4.6.10: New Log__c & LoggerSettings__c fields #228
jongpie
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
LoggerSettings__c
custom hierarchy settings.New field
Log__c.Scenario__c
Closed #217 by adding a new field suggested by @fentes,
Log__c.Scenario__c
, that can be set via Apex, Flow and lightning components. This field is provided as a way for org's to self-identify the context of the current transaction. It fully relies on the org's metadata to handle setting this - nothing within Nebula Logger automatically sets this field. In the event that the scenario is set multiple times in a single transaction, then the last scenario specified will be the value used forLog__c.Scenario__c
.Conceptually, this serves a similar purpose to the tagging system - however, tagging is more focused on identifying certain
LogEntry__c
records, where as the Scenario field is focused on identifying a particularLog__c
record.Log__c
object - stored inLog__.Scenario__c
LogEntry__c
object - related viaLogEntryTag__c
junction objectLog__c
recordLogEntry__c
recordSpecifying Scenario in Apex
When logging from within Apex, simply call the method
Logger.setScenario(String scenario)
before callingLogger.saveLog()
to specify the current transaction's scenario.Specifying Scenario in Lightning Components
When logging from within lightning web components and aura components, you can specify the scenario by calling the
logger
functionsetScenario(scenario)
- this function expects a String to be passed as the parameter. This example shows a basic example of how you can specify the log's scenario and save any pending log entries.Specifying Scenario in Flow
With adding a log entry from Flow, you can now optionally set the transaction's scenario, using the provided property
Scenario
- this property is available in all 3 Flow classes (FlowLogEntry
,FlowRecordLogEntry
, andFlowCollectionLogEntry
).Scenario Field in
Log__c
List ViewsThe new
Scenario__c
field is now included in the "All Logs" list view - you can also add the new field to any of your own list views.Scenario Field on
Log__c
Detail PageThe new
Scenario__c
field is also included on theLog__c
record's detail page, under the section "Log Management"Manually Updating the Scenario Field via Log's "Manage" Quick Action
In some situations, you may want to manually change the value of the field
Log__c.Scenario__c
- this can now be done using the "Manage" quick action. Simply click the "Manage" button on aLog__c
record (or select multiple logs from a list view and click "Manage"), and you can then update the field's value.New field
Log__c.LoggerVersionNumber__c
Another field has also been included to store which version of Nebula Logger created the
Log__c
record. This will will be helpful in trying to troubleshoot any issues/questions with logging. It also provides a way to know which version is deployed to orgs that are using the unpackaged metadata instead of the unlocked or managed packages (i.e., the metadata has been deployed directly to an org).New
LoggerSettings__c
fieldsAdded 2 new LoggerSettings__c fields to provide a little more control. Both are enabled by default, but to help with performance, these settings should typically be disabled in production unless you are actively troubleshooting an issue.
IsApexSystemDebugLoggingEnabled__c
- When enabled, Logger will automatically call Apex'sSystem.debug()
when logging via Apex, Flow/Process Builder, or Lightning ComponentsIsComponentConsoleLoggingEnabled__c
- When enabled, Logger will automatically call the browser'sconsole.log()
function when logging via Lightning ComponentsLogBatchPurger
EnhancementClosed #223 by adding an extra filter in
LogBatchPurger
so that anyLog__c
records with 0 log entries will be deleted, regardless of log's the retention dateAuth.RegistrationHandler
Logging BugfixLogger
forUserInfo.getSessionId() == null
to avoid an uncatchable error that can occur when callingSystem.Request.getCurrent()
Code Quality & Pipeline Enhancements
A few other changes have been included to improve the overall code quality:
sfdx-project.json
+README.md
This discussion was created from the release New Log__c & LoggerSettings__c fields.
Beta Was this translation helpful? Give feedback.
All reactions