Skip to content

Commit

Permalink
New 'Log Scenario Rules' CMDT (#237)
Browse files Browse the repository at this point in the history
* Closed #235 - Added new CMDT LogScenarioRule__mdt to override the user's logging level & retention date for a particular scenario

* Fixed #247 - Removed the new Logger Admin dashboard from the core package, and instead converted it into a plugin package. @jverelst pointed out that there is an org limit on the number of dynamic dashboards, so including the dashboard can cause issues for some orgs. Making it an optional plugin avoids this issue

* Updated build script so that it syncs the unlocked package version number in README.md from sfdx-project.json
  • Loading branch information
jongpie authored Nov 10, 2021
1 parent ab7dc20 commit cc8f333
Show file tree
Hide file tree
Showing 32 changed files with 386 additions and 91 deletions.
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

Designed for Salesforce admins, developers & architects. A robust logger for Apex, Lightning Components, Flow, Process Builder & Integrations.

## Unlocked Package v4.6.11
## Unlocked Package - v4.6.12

[![Install Unlocked Package](./content/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l2qQAA)
[![Install Unlocked Package](./content/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l2qQAA)
[![Install Unlocked Package in a Sandbox](./content/btn-install-unlocked-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3oQAA)
[![Install Unlocked Package in Production](./content/btn-install-unlocked-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3oQAA)
[![View Documentation](./content/btn-view-documentation.png)](https://jongpie.github.io/NebulaLogger/)

## Managed Package v4.6.0
## Managed Package - v4.6.0

[![Install Managed Package](./content/btn-install-managed-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015keOQAQ)
[![Install Managed Package](./content/btn-install-managed-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015keOQAQ)
[![Install Managed Package in a Sandbox](./content/btn-install-managed-package-sandbox.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015keOQAQ)
[![Install Managed Package in Production](./content/btn-install-managed-package-production.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015keOQAQ)
[![View Milestone](./content/btn-view-managed-package-milestone.png)](https://github.com/jongpie/NebulaLogger/milestone/6)

---
Expand Down Expand Up @@ -575,16 +575,6 @@ The Logger Console app provides access to the tabs for Logger's objects: `Log__c

![Logger Console app](./content/logger-console-app.png)

### Logger Admin Dashboard

To help monitor logs in your org, the Logger Console app's homepage displays the included dashboard 'Logger Admin' - it displays several report charts to quickly see summary info about your logs. The dashboard supports filtering on:
- Timestamp: based on `LogEntry__c.Timestamp__c`
- Logging Level: based on `LogEntry__c.LoggingLevel__c`
- Origin Type: based on `LogEntry__c.OriginType__c`
![Logger Console Home](./content/logger-console-app-home.png)
### Log's 'Manage' Quick Action
To help development and support teams better manage logs (and any underlying code or config issues), some fields on `Log__c` are provided to track the owner, priority and status of a log. These fields are optional, but are helpful in critical environments (production, QA sandboxes, UAT sandboxes, etc.) for monitoring ongoing user activities.
Expand Down
Binary file removed content/logger-console-app-home.png
Binary file not shown.
2 changes: 1 addition & 1 deletion managed-package/sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Nebula Logger - Managed [email protected]": "04t5Y000000XJZ7QAO",
"Nebula Logger - Managed [email protected]": "04t5Y000000Xg4wQAC",
"Nebula Logger - Managed [email protected]": "04t5Y000000YLDLQA4",
"Nebula Logger - Managed [email protected]config-default-save-method": "04t5Y0000027FFgQAM",
"Nebula Logger - Managed [email protected]configurable-default-save-method": "04t5Y0000027FFgQAM",
"Nebula Logger - Managed [email protected]": "04t5Y0000027FMhQAM",
"Nebula Logger - Managed [email protected]": "04t5Y0000015keOQAQ"
}
Expand Down
13 changes: 13 additions & 0 deletions nebula-logger-plugins/Logger-Admin-Dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Logger Admin Dashboard for Nebula Logger

> :information_source: Requires Nebula Logger v4.6.12 or newer
[![Install Unlocked Package Plugin](./content/btn-install-unlocked-package-plugin.png)](https://test.salesforce.com/packaging/installPackage.apexp?p0=04t5Y0000015l3yQAA)

To help monitor logs in your org, this plugin includes a new Logger Admin dynamic dashboard, as well as several new reports. The dashboard displays several report charts to quickly see summary info about your logs. It supports filtering on:

- Timestamp: based on `LogEntry__c.Timestamp__c`
- Logging Level: based on `LogEntry__c.LoggingLevel__c`
- Origin Type: based on `LogEntry__c.OriginType__c`

![Logger Admin Dashboard](./content/logger-admin-dashboard.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@
</dashboardGridLayout>
<dashboardType>LoggedInUser</dashboardType>
<isGridLayout>true</isGridLayout>
<runningUser>[email protected]</runningUser>
<textColor>#000000</textColor>
<title>Logger Admin Dashboard</title>
<titleColor>#000000</titleColor>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Layout xmlns="http://soap.sforce.com/2006/04/metadata">
<layoutSections>
<customLabel>false</customLabel>
<detailHeading>true</detailHeading>
<editHeading>true</editHeading>
<label>Information</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>MasterLabel</field>
</layoutItems>
<layoutItems>
<behavior>Required</behavior>
<field>DeveloperName</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Edit</behavior>
<field>IsEnabled__c</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>true</customLabel>
<detailHeading>true</detailHeading>
<editHeading>true</editHeading>
<label>Rule Details</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>Scenario__c</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>UserLoggingLevel__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>NumberOfDaysToRetainLogs__c</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>false</customLabel>
<detailHeading>true</detailHeading>
<editHeading>true</editHeading>
<label>System Information</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
<field>NamespacePrefix</field>
</layoutItems>
<layoutItems>
<behavior>Readonly</behavior>
<field>CreatedById</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Edit</behavior>
<field>IsProtected</field>
</layoutItems>
<layoutItems>
<behavior>Readonly</behavior>
<field>LastModifiedById</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsTopToBottom</style>
</layoutSections>
<layoutSections>
<customLabel>true</customLabel>
<detailHeading>true</detailHeading>
<editHeading>false</editHeading>
<label>Custom Links</label>
<layoutColumns />
<layoutColumns />
<layoutColumns />
<style>CustomLinks</style>
</layoutSections>
<showEmailCheckbox>false</showEmailCheckbox>
<showHighlightsPanel>false</showHighlightsPanel>
<showInteractionLogPanel>false</showInteractionLogPanel>
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
<summaryLayout>
<masterLabel>00h17000007yeDt</masterLabel>
<sizeX>4</sizeX>
<sizeY>0</sizeY>
<summaryLayoutStyle>Default</summaryLayoutStyle>
</summaryLayout>
</Layout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<label>Log Scenario Rule</label>
<pluralLabel>Log Scenario Rules</pluralLabel>
<visibility>Public</visibility>
</CustomObject>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>IsEnabled__c</fullName>
<defaultValue>true</defaultValue>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Is Enabled</label>
<type>Checkbox</type>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>NumberOfDaysToRetainLogs__c</fullName>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<inlineHelpText
>This value is used to set the field Log__c.LogRetentionDate__c, which is then used by LogBatchPurger to delete old logs. To keep logs indefinitely, set this field to blank (null).</inlineHelpText>
<label>Days to Retain Logs</label>
<precision>4</precision>
<required>false</required>
<scale>0</scale>
<type>Number</type>
<unique>false</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Scenario__c</fullName>
<caseSensitive>false</caseSensitive>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Scenario</label>
<length>255</length>
<required>true</required>
<type>Text</type>
<unique>true</unique>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>UserLoggingLevel__c</fullName>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<inlineHelpText
>Overrides the user&apos;s logging level (normally controlled via LoggerSettings__c.LoggingLevel__c) for any transactions with the specified Scenario</inlineHelpText>
<label>User Logging Level</label>
<required>true</required>
<type>Picklist</type>
<valueSet>
<restricted>true</restricted>
<valueSetDefinition>
<sorted>false</sorted>
<value>
<fullName>ERROR</fullName>
<default>false</default>
<label>ERROR</label>
</value>
<value>
<fullName>WARN</fullName>
<default>false</default>
<label>WARN</label>
</value>
<value>
<fullName>INFO</fullName>
<default>false</default>
<label>INFO</label>
</value>
<value>
<fullName>DEBUG</fullName>
<default>false</default>
<label>DEBUG</label>
</value>
<value>
<fullName>FINE</fullName>
<default>false</default>
<label>FINE</label>
</value>
<value>
<fullName>FINER</fullName>
<default>false</default>
<label>FINER</label>
</value>
<value>
<fullName>FINEST</fullName>
<default>false</default>
<label>FINEST</label>
</value>
</valueSetDefinition>
</valueSet>
</CustomField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ListView xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>All</fullName>
<columns>MasterLabel</columns>
<columns>DeveloperName</columns>
<columns>IsEnabled__c</columns>
<columns>Scenario__c</columns>
<columns>UserLoggingLevel__c</columns>
<columns>NumberOfDaysToRetainLogs__c</columns>
<filterScope>Everything</filterScope>
<label>All</label>
</ListView>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<inlineHelpText
>This value is used to set the field Log__c.LogRetentionDate__c, which is then used by LogBatchPurger to delete old logs. To keep logs indefinitely, set this field to blank (null).</inlineHelpText>
<label>Days to Retain Logs</label>
<precision>3</precision>
<precision>4</precision>
<required>false</required>
<scale>0</scale>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>Tab</actionName>
<content>LoggerConsoleHomePage</content>
<formFactor>Large</formFactor>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Flexipage</type>
<pageOrSobjectType>standard-home</pageOrSobjectType>
</actionOverrides>
<brand>
<headerColor>#1E1E1E</headerColor>
<shouldOverrideOrgTheme>true</shouldOverrideOrgTheme>
Expand All @@ -19,7 +11,6 @@
<isNavPersonalizationDisabled>false</isNavPersonalizationDisabled>
<label>Logger Console</label>
<navType>Console</navType>
<tabs>standard-home</tabs>
<tabs>Log__c</tabs>
<tabs>LogEntry__c</tabs>
<tabs>LogEntryTag__c</tabs>
Expand Down Expand Up @@ -50,9 +41,6 @@
<mappings>
<tab>standard-Dashboard</tab>
</mappings>
<mappings>
<tab>standard-home</tab>
</mappings>
<mappings>
<tab>standard-report</tab>
</mappings>
Expand Down
Loading

0 comments on commit cc8f333

Please sign in to comment.