shreyas-girjapure / apex-logging

Reusable and Minimal Logging Framework Using Platform Events.
1 stars 2 forks source link

Core Logging Utility Features #3

Closed shreyas-girjapure closed 2 years ago

shreyas-girjapure commented 2 years ago

Core Logging Utility Plan

  1. Developer will simply call a method and pass exception and other parameter to it.
  2. Event will be raised in channel and logged into custom object.
  3. Logged event can be monitored Realtime from logging monitor.

Steps breakdown , future scope and Expectations

Developer will call a method and pass exception and other parameter to it.

Features :

  1. Usually logging libraries bring overhead to developer and are not developer friendly. Making shy away from using those utilities.
  2. Methods written should ask for minimum parameters and should focus on logging exception and getting most data automatically.
  3. This needs a feasibility check if Class name and method name can be calculated from raised exceptions.
  4. Database.methods should also be supported for handling bulk exceptions.
  5. Extra details should be provided to the passed exception types. For example : DMLExceptions bring extra information like accessible fields with them. Handling and presenting them in proper way should be taken care of.

Event will be raised in channel and logged into custom object.

Features :

  1. Since we are focusing on logging vial platform events. Logged exceptions will be raised realtime into event bus.
  2. structure of raised event should be readable from any format or platform.
  3. Custom objects are to be maintained for reporting and auditing purposes. Fields should be easily portable when converting to bigObject [future scope].
  4. Need to check limitations of converting customObject to bigObject.

Logged event can be monitored Realtime from logging monitor.

Features :

  1. User friendly logging monitor should be provided for realtime log monitoring on production orgs.
  2. This utility should be able to subscribe and unsubscribe for logged events.
  3. Filtering capabilities should be provided out of the box.
  4. Dedicated Logging Salesforce Application needs to be provided with the framework.
  5. Either LWC logging list view or utility bar lwc component should be provided

Process and framework opinion adherence

Features

  1. Since this is an opinionated framework. Adhering to framework opinions and practices and guarding developers going against them is equally important.
  2. PMD rulesets for logging best practices should be provided with utility.
  3. Extra Tabs for frequent best practices should be provided [future scope]

Logging for LWC , Batches and Automations

Features :

  1. Keeping this out of scope for now
  2. LWC , Batches and Automation unified support should be introduced once current feature scope ends.