Skip to content
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

Is it possible to configure Logger to not log for specific Apex classes/triggers? #347

Closed
mikesobczak opened this issue Aug 5, 2022 · 2 comments · Fixed by #357
Closed
Assignees
Labels
Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Logger Engine Items related to the core logging engine Type: Enhancement New feature or request

Comments

@mikesobczak
Copy link

Or would I need to write custom code to disable the Logger wherever needed?

@jongpie
Copy link
Owner

jongpie commented Aug 9, 2022

@mikesobczak great question! At the moment, this isn't currently supported - I had started a prototype of this feature about 1.5 years ago, but never finished implementing it. I can revisit this idea sometime in the next few months - in the meantime, you'll have to write your own code to handle this.

@jongpie jongpie added Type: Enhancement New feature or request Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Logger Engine Items related to the core logging engine labels Aug 9, 2022
@jongpie jongpie self-assigned this Aug 9, 2022
jongpie added a commit that referenced this issue Sep 22, 2022
* Closed #347 & #356 by deprecating LogScenarioRule__mdt object & replacing it with a new object LoggerScenarioRule__mdt that provides optional overrides for all fields on LoggerSettings__c

* Added new Apex class LogScenarioRule to manage accessing LoggerScenarioRule__mdt CMDT records

* Incorporated the stellar idea from @jamessimone to tie LogEntry__c records to the new LoggerScenario__c object via a new lookup field LogEntry__c.EntryScenario__c

* Added new method Logger.endScenario(String) so that Apex developers can explicitly end a scenario, which then automatically rolls back to the previous scenario (and re-applies the previous scenario rule, if one exists) - another fantastic suggestion from @jamessimone

* Renamed LoggerSettings__c.DefaultLogScenario__c to LoggerSettings__c.DefaultScenario__c for consistency

* Fixed #360 by changing Logger.logDatabaseErrors() overloads to always return a non-null instance of LogEntryEventBuilder

* Updated some formatting in SlackLoggerPlugin to better format stack traces & create new plugin package version v1.5.0

* Fixed #363 by correcting some references in the migration script ./scripts/data/migrate-log-scenario-field-to-logger-scenario-object.apex

* Added content in README that links to the wiki's architecture overview

* Removed build numbers for package versions in sfdx-project.json, upgraded some packages in package.json to resolve some GitHub security alerts
@jongpie
Copy link
Owner

jongpie commented Sep 22, 2022

Closing this out, this is now possible using the changes released in v4.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Logger Engine Items related to the core logging engine Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants