«

»

Sep 25

Handy logging info..

I have an issue when it comes to debugging if a problem hits on the live environment. For some reason I cannot get the debugger to attach..

As a temporary solution, I made use of a technique pointed out by Clin Byrne on the SUGUK forums that makes use of the MICROSOFT.OFFICE.SERVER.DIAGNOSTICS namespace, and more importantly, the PortalLog object.

This method is VERY simple to use, all you need is a reference in your project to the Microsoft Office Server.dll.

Once thats in place, you can use the following at any point in your code to dump an entry into the latest log in the 12 Hive.

PortalLog.LogString("Any freeform text your like here")

Reg.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.