Reputation: 199
We are planning to implement custom error logging using Azure. I came across few articles which suggest using Azure monitor logs or Azure application insights. Our error logging includes storing each exception details in JSON format. We will pass these details in JSON format to either Azure monitor logs or Azure application insights. What are the advantages over other in this scenario and which is best suit for this requirement. Thanks.
Upvotes: 1
Views: 815
Reputation: 29840
Azure Application Insights is part of Azure Monitor, so you cannot do a comparison between them. If you have developed your own application Application Insights is a good fit as it will have some logging out of the box and there are SKDs for most languages
You can add additional details to telemetry logged by application insights by using a Telemetry Initializer or you can create your own ExceptionTelemetry
and enrich that:
var telemetry = new TelemetryClient();
try
{
// ...
}
catch (Exception ex)
{
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);
}
Custom details are stored as a key/value pair, so you can add your own json document as a value if needed.
Upvotes: 2