Skip to content

Best Practice for .saveLog() with PlatformEvent #244

Answered by jongpie
MorganMarchese asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MorganMarchese - that's a great question, you will definitely want to put some thought into where you call saveLog() since there are some transactional limits that could be exceeded if you call it too many times.

I've implemented Nebula Logger in several different trigger handler frameworks over the years (Nebula Logger was originally part of a trigger handler framework from another repo I maintained) - I definitely recommend incorporating some calls to saveLog() directly into your trigger framework.

When using logger within a trigger handler framework, I personally aim for 2 uses:

  • Save the log any time an exception happens within the trigger handlers
  • Save the log after all logic in …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jongpie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants