Written by

Product Support at InterSystems Japan
Article Megumi Kakechi · Jul 18, 2024 1m read

How to put application logs into the global ^ERRORS

InterSystems FAQ rubric

This can be done with TRY-CATCH:

#dim ex As%Exception.AbstractExceptionTRY {
    //Code that causes an error
  }
  CATCH ex {
     do ex.Log()
  }

If you use ^%ETN, call it from the BACK entry (BACK^%ETN).

Please also take a look at the related article: How to get application errors (^ERRORS) using a command

Comments

Ben Spead · Mar 21

Always a helpful way to add debugging code or long term exception logging!

Also, if you don't have an exception object and just want to log the stack for debugging purposes, you can use LOG^%ETN

0