-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Log__c & LoggerSettings__c fields #218
Conversation
@jongpie Thank you very much for implementing this feature into the main framework. This will really help to keep the overview of all Logs and let us easily find the wanted log. |
@fentes, here is a beta version of the new v4.6.10 package that you can install to test out the changes - https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015krXQAQ
Let me know if you have any feedback! |
I quickly got tired of creating new button images for each release (to include the v number), and there previously weren't any install links for sandboxes
…tened some settings field labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions but in general this looks great!
Thanks to @jamessimone for the code review!
@jamessimone thanks for reviewing this! |
New field
Log__c.Scenario__c
Closes #217 by adding a new field,
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