Sunday, June 30, 2013

SharePoint 2010 ULS Logging - C#

I want to share the ULS logging code that I have planned to use from now.
The credit goes to: http://msdn.microsoft.com/en-us/library/gg512103(v=office.14).aspx

Sample code for how you can use it:
UlsLogging.LogInformation("This is information message");
UlsLogging.LogInformation("{0}This is information message","Information:");

UlsLogging.LogWarning("This is warning message");
UlsLogging.LogWarning("{0}This is warning message", "Warning:");

UlsLogging.LogError("This is error message");
UlsLogging.LogError("{0}This is error message","Error:");

No comments: