Get Application Error Log by SQL

Primary tabs

Replies

Hi Lucas,

I don't know if Cache or IRIS provides such feature. However, you could create a %Persistent class and link its data to ^ERRORS global in class's storage section.

Recently, @Robert Cemper did a great example mapping ^SPOOL global to a persistent class. May be this example could helps you.

José
 

Did you take a look at the SYS.ApplicationError class? It has methods and class queries for reading the Application Error Log.

For example, to get the dates when errors were logged for a particular namespace TEST, you can use

do ##class(%ResultSet).RunQuery("SYS.ApplicationError", "DateList", "TEST")  

Or to manually parse the results, you can use

set $NAMESPACE = "%SYS"
set resultSet = ##class(%Library.ResultSet).%New("SYS.ApplicationError:DateList")
set status = resultSet.%Execute("TEST")

Thanks for the hint. 
I was pretty sure there should be something similar to serve SysMgmtPortal. I just didn't know.
Obviously the authors had the same problems as me with the old structure and applied a bunch of custom queries.
I don't think I missed something:
- the class is deployed so you have to accept what it does.
differently  %ERN.int doesn't hide anything and speaks full truth. 
- next to use it you require full access rights to %SYS and a namespace change %SYS to run it.
- and finally the topmost requirement: The queries are invisible to SQL! 
Just because not being exposed as SqlProcedure.

My solution runs in any namespace on Caché / Ensemble / iris .
Without any privileges and doesn't touch any ISC copyrights!

Hi Lucas!

With 

zpm "install objectscript-errors-analytics"

you can also see examine these errors in the IRIS Analytics dashboard. Check for more.