Repository navigation
|
I am in the procedure of adding nebula logging in our code. Then I was thinking, could I add Logger.info('nice to have info'), but only save these log entries if I get an exception, where I will add Logger.error('error').setexceptionDetails(e) and Logger.saveLog() in the catch block. Will there be any implication to not save the entries inside a method you a calling? |
Answered by
jongpie
May 20, 2025
Replies: 1 comment
|
Hi @kenhov - that should be completely fine to do. When there are any unsaved log entries, they are simply discarded automatically at the end of an Apex transaction. It's really up to you to decide if/when you save the log entries, and there shouldn't be any issues with opting to not save them. |
0 replies
Answer selected by
kenhov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kenhov - that should be completely fine to do. When there are any unsaved log entries, they are simply discarded automatically at the end of an Apex transaction. It's really up to you to decide if/when you save the log entries, and there shouldn't be any issues with opting to not save them.