Using Application Insights for Client Side logging

0
Hi,   At a client we run our apps in Azure (Mendix for Private Cloud). We also manage our monitoring via Azure. So far we only do this for the server logging, but we would like to also monitor the client side error so that it is also easy to find any errors that only happened client side.    Our plan is to implement a solution using Azure Application Insights. This should not be hard and we've almost managed to do this.    Basically what we've done is added a piece of Javascript on a top level page layout, which can be found here: Microsoft Azure Monitor Application Insights JavaScript SDK - Azure Monitor | Microsoft Learn   It works for a lot of stuff, but not for the things we really want to capture: the uncaught exceptions that happen in logic (nanoflows). This is because they're not really uncaught. Mendix wraps nanoflows with an error handler. It does log to the client, but apparently, this is not seen by Application Insights. We can't figure out how we can go around this or how to make this error handler go to Application Insights.  We can track all page views and if security error happen that were not caused by a nanoflow then we're also good, but logic is unfortunately caught by Mendix itself.   Does anyone have experience doing this? 
asked
1 answers
0

Hi Jord,

 

For error capturing, you'll need to catch them server-side. It depends on what you are trying to see, for instance, I've got the Mendix logs shipping from multiple instances into Azure Log Analytics.

 

Basically, you can use the Azure Monitor SDK within a javaagent, this provides far better customization of the received logs IMO.  You can use OpenTelemetery javaagents from the monitoring companies such as Azure Monitor, Dynatrace, NewRelic, they all have them, failing that you can create them in java. 

 

There are many ways to get logs into Azure Monitor, as mentioned above, or through APIS and DCR, DCE, etc. 

 

I use Microsoft's OpenTelemetry Java Distro application to get all the logs from the Mendix logs in real time, near real time, runs about a minute behind, but that's to do with Azure's ingestion.  I'm doing this on versions 10.21.0 and above.  No idea about Mendix Studio 9.x

answered