SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I developed a ActiveX Component (C#) for SharePoint 2010 and would like to send log/debug messages to the SP-Server so that they are viewable in the SharePoint LOGS Folder. How am I doing this?

Like the server-side SPDiagnosticsService.Local.WriteTrace(...) function. Isn't there any Client-Object-Model function to do this? Or maybe in Javascript, I guess I could call a Script aswell.

share|improve this question
up vote 0 down vote accepted

Suggestion #5 – Utilize diagnostics.asmx web service for the client side applications

It turns out that SharePoint has a /_vti_bin/diagnostics.asmx web service. It has only one method which performs log writing to the ULS with “SharePoint Foundation -> Unified Logging Service” category and “Verbose” level.

If you are crafting Silverlight or JavaScript application, then that web service could be the only way to perform logging which could be accessible by developers or administrators. Other options are quite hard to implement.

SharePoint has lots of Java Script libraries, and it also has functions such as ULSOnError(msg, url, line) and ULSSendException(ex). One does not simple call these functions, so you just need to include additional call ULS.enable with “true” value. Otherwise, you will not get anything at all.

ULS.enable = true;
ULSOnError("Hello trace", document.location.href, 0);

Then you call this JavaScript from your ActiveX Code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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