I am messing around with application insights in Azure and was wondering if there is a way to also log the payload that is being processed in for example the Api when logging data with application insights?
Maybe i have misunderstood the use-case of A.I.. is this even a good way to use it or am i suppose to do this kind of logging in another resource?
EDIT
So i managed to do it in some what the way i wanted it to loo like. i can now see custom values in analytics though Application Insights. I used this simple code to Create my properties and then save related values to them.
The only drawback is that the value of a specific key can only be about 100 chars or so. Which is understandable regarding the amount of data they would otherwise store... Would be nice to be able to save the whole stack trace with line numbers and such though...
var telemetry = new TelemetryClient();
...
try
{ ...
}
catch (Exception ex)
{
// Set up some properties:
var properties = new Dictionary <string, string>
{{"Game", currentGame.Name}};
var measurements = new Dictionary <string, double>
{{"Users", currentGame.Users.Count}};
// Send the exception telemetry:
telemetry.TrackException(ex, properties, measurements);
}
(Code-snippet taken from Microsofts documentation: here)
My idea of solving my little problem with stack-trace is to sub-string the different snippets i want to store. Such as location and line number for example.