Open brettsam opened 6 years ago
Agreed, there should be an implicit Flush for fatal Exceptions. But I believe this should also apply to caught ones explicitly logged with TraceException. Exceptions will hopefully be rare and are very important to capture, and if debugging, see promptly so I think the overhead of flushing them is worth it against the usefulness of getting them quickly.
Since App Insights batches-and-flushes telemetry and also has a fire-and-forget mechanism for flushing, we can't be guaranteed that messages have made it to the service before we kill the process.
We may be able to implement something similar to this comment for things like the "Host thresholds exceeded" message: https://github.com/Microsoft/ApplicationInsights-dotnet/issues/407#issuecomment-318208844.