0

I have made couple of Windows 8 application but I haven't implemented logging mechanism.

I have tried to search for implementing error logging or any other logging in Windows 8 Application but each shows only way to log on local device.

How can I create a logging mechanism which logs any error or issue in Windows 8 Application on user end and send me the report through Email or save on some remote server.

Few logging mechanism that I found are:

  1. http://blogs.msdn.com/b/agile/archive/2013/02/07/embracing-semantic-logging.aspx
  2. http://blogs.msdn.com/b/eternalcoding/archive/2012/08/07/tips-and-tricks-for-c-windows-8-developer-try-to-catch-the-famous-it-works-for-me-bug.aspx

But these logging mechanism doesn't send me a report through Email or on some server.
How can I achieve that. If possible provide some code.

Security Hound
  • 2,577
  • 3
  • 25
  • 42
Balraj Singh
  • 3,381
  • 6
  • 47
  • 82

1 Answers1

1

So you can send e-mails via sharing, as outlined in the question from the comments: How do I send an email from a WinRT/Windows Store application?. That's one way, but it forces the user to use their mail client, which I do not think is a great user experience.

If you have a remote server that you can write and run some kind of error report service on, your app will just have to make a service call out to it and you can present a friendly message to the user saying "your report has been submitted" or whatever you'd like. The challenge there is writing this remote server.

Can't really provide code as it depends on what back end technology you want to use, what you want to do with the data you receive, etc.

EDIT: In terms of a better way to track errors, better than what? You should be following whatever best practices. In addition, your Windows.UI.Xaml.Application object has a UnhandledException event with which you can handle any exceptions on the UI thread that were not handled in your code. I'd create some kind of component in which you queue up error reports. If you need user input, it would show that UI. One a report is ready, it would send it over to your web service.

Community
  • 1
  • 1
Szymon Rozga
  • 17,971
  • 7
  • 53
  • 66