I'm hoping that someone can answer a question of why logging occurs in one location but not in another. I am using the snippet-based-setup to enable the logging and I have two simple test logs that I entered into JavaScript that I have on the page.
$(document).ready(function () {
RetrieveSessionData(function (d) {
formData = d;
var prop = { "SessionCode": getSessionCode() };
var met = { "model risk type": formData.projectionData.modelRiskType };
appInsights.trackEvent("ACTIONS-JS-READY", prop, met);
appInsights.trackEvent("ACTIONS-JS-READY2", "prop", "met");
appInsights.flush();
});
var properties = { "SessionCode": getSessionCode() };
var metrics = { "metrics field": 10 };
appInsights.trackEvent("ACTIONS-JS", properties, metrics);
appInsights.flush();
});
The appInsights.trackEvent lines in the RetrieveSessionData function do not log anything, nor do they return any sort of error/message at all letting me know there is an issue. The one at the bottom of the script, outside of the function, does log a custom event into application insights.
What am I missing on this? I haven't found any specific examples on the proper way to do JavaScript logging inside of functions or can it not be done?
