Archive

Archive for October, 2011

How to write programmatically into ULS log?

October 14, 2011 Leave a comment

Hi Friends,

SharePoint uses ULS log to add the activities like error logging, notifications and other. ULS log is available at 14hive/Logs folder.

So, why can’t we use the same to log our exceptions and information.

We can use following code to log the entry in ULS log.Remember to add the reference to the Microsoft.Office.Server dll in your project.

Microsoft.Office.Server.Diagnostic.PortalLog.LogString("Error – {0} – {1} – {2}",
"Message:",exception.Message+"\n Trace : ",exception.StackTrace);

Happy coding….

Advertisements

How to see the code or text of a SQL trigger

October 14, 2011 Leave a comment

Hi Friends,

To see the code or text of a SQL trigger use following query

exec sp_helptext ‘{Name of trigger}’