-
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? |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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.