Sharepoint error logging by the system -
i have worked on php (lamp) , have started working on sharepoint. in case of php errors captured , shown in apache error log in case of sharepoint have use try , catch block , use code shown below capture error. working fine me. no issues it. downside - have vigilant enough make sure put try catch every possible place.
i want php, i.e. log things automatically. please help.
microsoft.sharepoint.spsecurity.runwithelevatedprivileges(delegate() { spdiagnosticsservice diagsvc = spdiagnosticsservice.local; spdiagnosticscategory cat = diagsvc.areas["sharepoint foundation"].categories["unknown"]; string format = "test trace logging gggg category {0} in area {1}"; diagsvc.writetrace(1, cat, traceseverity.medium, format, cat.name, cat.area.name); });
i'm afraid ahve deal errors yourself. sharepoint implements own logs things wants handle. extended errors or custom error logging must implemented you.
in case, use base classes webparts, layouts , classes , code error handling in single place. class element inheriting base classess automatically handles errors.
anyway, implement custom service , log erros uls or create similar base classes common elements. take article might out. http://blog.mastykarz.nl/logging-uls-sharepoint-2010/
Comments
Post a Comment