2010-02-19 17 views

Répondre

2

de How to write to ULS Log in SharePoint 2010 from a .NET app?

Cela a vraiment amélioré dans SP2010. Maintenant, vous pouvez écrire facilement dans les journaux ULS même avec SharePoint Foundation. Tout ce que vous avez à faire est ceci:

SPDiagnosticsService diagSvc = SPDiagnosticsService.Local; 
diagSvc.WriteTrace(0, // custom trace id 
new SPDiagnosticsCategory("My category", 
TraceSeverity.Monitorable, 
EventSeverity.Error), // create a category 
TraceSeverity.Monitorable, // set the logging level of this record 
"Writing to the ULS log: {0}", // custom message 
new object[] { "SharePoint rocks!"} // parameters to message); 

fonctionne très bien, mais pas dans solutions ... sandbox