Get Application Error Log by SQL
Does anyone know if there is a table or query to get the Application Error Log (^ERRORS) by SQL?
Comments
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é
It was a little bit more complicated than expected. Anyhow take a look
SQL for ^ERROR Global
Thanks to @José Roberto Pereira for the inspiration.
Hi @Robert Cemper, I'm going to do some tests with your example, thank you!
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!
Thank you @Igor Titarenko, it is exactly what I was looking for.
Hi Lucas!
With
zpm "install objectscript-errors-analytics"
you can also see examine these errors in the IRIS Analytics dashboard. Check for more.