1

I do a large amount of client side development using SharePoint as the back end. In most cases I rely heavily on the REST API and JSOM. I tend not to use the SharePoint masterpages and deploy my single-page apps into _layout so that I can avoid some of the drawbacks of SharePoint heavy ASP.NET components. So I would not be able to write to the ULS or anything like that.

For other developers who are using JavaScript heavily in SharePoint how do you do instrumentation and error reporting? Should I write my error to a custom list? Or is there another way this might be better handled in SharePoint? Or should I just use something more standard?

1
  • I posted an answer below but I'd be really interested to hear how others are doing this as well. +1 Jun 30, 2013 at 19:08

2 Answers 2

1

My teams have built frameworks for dealing with errors by logging them to a custom list. This works really well for sandbox code as well as client side code. You can customize the structure of the list to reflect what's important to you. We usually include a category, query string parameters, and URL in our lists.

In many ways this approach is superior to the ULS logs. Our QA people and power users can easily find the error in the list when they report issues with the solution, and link the error message to their bug reports. We can also filter and sort the list to get a better view of what's going on with the site.

1
  • Thanks for the answer. I am a bit disappointed that no one else chimed in, though. Jul 11, 2013 at 13:29
1

The Diagnostics web service exposes a single method named SendClientScriptErrorReport that enables client applications to report errors to the ULS service.

Refer the below link for details: https://msdn.microsoft.com/en-us/library/office/hh803115(v=office.14).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.