Sharepoint Error Loging, as comfortable as a Coffeemachine

Interessant ist folgendes Snippet:

Microsoft.Office.Server.Diagnostics.PortalLog.LogString("Error in WebPart: {0}, {1}, {2}", "MyWebPart ",e.Message, "Fix IT!");

The Logging is simple and smoove, easily add your string you want to format and throw the values into it. (Similiar the string.format you should use! instead of += string + "info" ) 

My need was to catch the Exception, if a user doesn't have an EMail Adress, to inform the Admin (WFL) and restart base Workflow.

Microsoft.Office.Server.Diagnostics.PortalLog.LogString("Fehler in ListWatchDog: {0} ", "Benutzer: " + nUser.Name + " hat keine EMail Adresse hinterlegt");

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading