Forum General

A pretty straightforward question about better exception logging to App Center

UnreachableCodeUnreachableCode USMember ✭✭✭

I've been using App Center to log exceptions as a sole developer for a while now. It's met my needs up until this point. My issue now is that I have a handful of end users, and I'm finding it harder to sift through errors on App Center. Let me elaborate.

I have a RestService that will log all exceptions to app center like so (where _appCenterLoggingService is my injected wrapper of App Center methods):

catch (Exception ex)
      string payload = string.Empty;
      if (!secureLogging)
          payload = serialized;

      var parameters = new Dictionary<string, string> {
          { "Url", uri },
          { "Payload", payload },

      await _appCenterLoggingService.LogErrorAsync(ex, parameters);

Now on App Center, I have my exception groups logged. But they're not very readable:

What's more, I have to search through the reports of each of these groups to find exceptions from different ViewModels.

But as you'll notice (on my censored exception :P) I am able to log custom exception classes like FakeExceptionClass and they are much more identifiable.

So my question is, can I change my code in _appCenterLoggingService.LogErrorAsync(ex, parameters) to log better titles for my exceptions, and group them more logically? I think the whole benefit of App Center should be to log exceptions I'm not expecting. And to make them more readable than RestService+<PostAsync>d__52[TRequest,TResult].MoveNext ()` or whatever. It would save me having to write catches for all types and log those speicific types. Is there a dynamic way of doing this?

Or is this a bug with App Center or HttpClient?

Sign In or Register to comment.