sharepoint logging and debugging: the troubleshooter’s best friend by jason himmelstein -...
DESCRIPTION
Technical Class: Wednesday, March 6 11:15 AM - 12:30 PMTRANSCRIPT
![Page 1: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/1.jpg)
SharePoint Logging & Debugging: The Troubleshooter’s Best Friend
Jason Himmelstein [email protected] @sharepointlhorn
![Page 2: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/2.jpg)
Jason’s contact & vitals Microsoft vTSP
virtual Technology Solutions Professional SharePoint Foundation Logger
http://spflogger.codeplex.com Web: www.sentri.com Blog: www.sharepointlonghorn.com Twitter: @sharepointlhorn LinkedIn: www.linkedin.com/in/jasonhimmelstein
Author of Developing Business Intelligence Apps for SharePoint http://bit.ly/SharePointBI
![Page 3: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/3.jpg)
So many people see the beauty…
![Page 4: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/4.jpg)
…but never get the full experience
![Page 5: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/5.jpg)
SharePoint Logging – a history
How has SharePoint traditionally done logging
IIS Logs
ULS Logs
Upgrade Logs
PSConfig Logs
![Page 6: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/6.jpg)
SharePoint Logging – new & improved!
New Functionality in SharePoint 2010
Correlation IDs
Flood Protection
Developer Dashboard
Configurable ULS Logs
Usage Logging (Web Analytics)
![Page 7: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/7.jpg)
Lets look at the big picture
![Page 8: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/8.jpg)
Configurable ULS Logs
Size limitation Easy Granular tuning, with visibility
into what’s tuned Ability to specify number of days to
log
![Page 9: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/9.jpg)
Flood Protection
I’m smart, why don’t I want to see
everything?
How does Flood Protection work?
How do I turn it off and on?With this option enabled, if the same event fires 5 times within 2 minutes, SharePoint will suppress the event from logging and throw a summary event at the 2 minute mark.
The default behavior and can be customized using PowerShell and the Set-SPDiagnosticConfig cmdlet.
![Page 10: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/10.jpg)
How deep do you really want to go?
![Page 11: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/11.jpg)
Flood Protection (cont’d)• How do I turn it off and on?
![Page 12: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/12.jpg)
Health Data Collection Health Logging timer jobs are disabled by default
Be selective in what you want to enable
How to enable: Central Admin | /_admin/ServiceJobDefinitions.aspx
Filter by Disabled and enable one by one Powershell commandlet: SPDiagnosticProvider Enable all Health Data Collection option in
Central Admin | /_admin/LogUsage.aspx
![Page 13: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/13.jpg)
Usage Logging
The drivers behind Web Analytics
True detail on who clicked what, and
what they saw
![Page 14: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/14.jpg)
Finding the root cause
![Page 15: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/15.jpg)
Correlation IDs What is this weird 32 character message and
why do I care?
How are they used in SharePoint 2010?
Why are they useful?
![Page 16: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/16.jpg)
The Developer Dashboard How do I turn it on for a limited scope only?
There’s some great info here for developers, but what
does it tell me from an Operations/Support perspective?
How can I convince my development team to code for it?
SPMonitored Scope Not available in Sandboxed Solutions
![Page 17: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/17.jpg)
The Developer Dashboard (cont’d) Enabling the dashboard
3 modes Off On OnDemand (recommended)
STSADM stsadm -o setproperty -pn developer-dashboard -pv [off | on |
ondemand] PowerShell
$j = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings; $j.DisplayLevel = ; $j.Update()
$j = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings; $j.DisplayLevel = 'OnDemand'; $j.Update()
Optional parameters
$j.TraceEnabled = $true;$j.RequiredPermissions = '%MaskSetting%';
![Page 18: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/18.jpg)
The Developer Dashboard (cont’d)
![Page 19: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/19.jpg)
The Developer Dashboard (cont’d)
Angry SharePoint!
![Page 20: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/20.jpg)
The Developer Dashboard (cont’d)
Happy SharePoint!
![Page 21: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/21.jpg)
SPMonitoredScope
The SPMonitoredScope class resides in the Microsoft.SharePoint.Utilities namespace. Example of wrapped code:
A tip for the best and most effective use of SPMonitoredScope: All calls to external components, such as custom databases, external Web services,
and so on, should be wrapped with SPMonitoredScope. This will make it easier for administrators to identify them as points of failure, and to isolate the problem quickly. Sandbox Solutions are not able to be wrapped in SPMonitoredScope
Measured statistics are written to the ULS logs as well as to the Developer Dashboard.
There are a few limitations for using SPMonitoredScope. Only calls to SharePoint databases are captured. Only the code wrapped with SPMonitoredScope that resides on the front-end Web
server appears on the Developer Dashboard. Code that executes on application servers only displays the SPMonitoredScope information in the ULS logs of the computer that the code is running on.
Create custom monitors by adding ISPScopedPerformanceMonitor to the current SPMonitoredScope
![Page 22: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/22.jpg)
demo Configurable ULS Logs
Flood Protection
Developer Dashboard
![Page 23: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/23.jpg)
DEMO
Web Analytics In Central Admin
Administrative Report Library – Search Admin Reports Health Reports -Slowest Pages & Top Active Users Break down by Web Application Traffic, Search Inventory
Configurable ULS Logs
![Page 24: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/24.jpg)
One Database to rule them all: The Logging database
What can it log? How do I tell it to start logging? How do I get the information out? Are there tools out there to help me
see the data more easily? BDC models SQL Views CodePlex Projects
Are there performance implications?
![Page 25: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/25.jpg)
NTEventLog in SPFLogger
![Page 26: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/26.jpg)
NTEvent Analytics in SPFLogger
![Page 27: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/27.jpg)
ULSTraceView in SPFLogger
![Page 28: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/28.jpg)
TimerJob Log in SPFLogger
![Page 29: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/29.jpg)
TimerJob Analytics in SPFLogger
![Page 30: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/30.jpg)
…and now its time for…
![Page 31: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/31.jpg)
SharePoint Server Performance
Governance & Troubleshooting Determine tolerance for custom solutions
Encourage Sandbox Solutions Require SPDisposeCheck Require SPMonitored Scope If you don’t have a Dev/QA Environment, you don’t
have a Production Environment Never test patches in Production Educate on the Developer Dashboard
![Page 32: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/32.jpg)
SharePoint Server Performance
Governance & Troubleshooting Never accept a solution that is not a
WSP Respect your users, or you won’t have
any Limit the number of Farm Admins Minimize Server Sprawl Audit your environment regularly Survey your users regularly Engage your Executive Sponsorship
![Page 33: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/33.jpg)
Handy Reference Information Useful Stuff
Jason’s info http://www.sharepointlonghorn.com [email protected] @sharepointlhorn
Todd Carter’s info @toddca http://www.todd-carter.com/
Russ Maxwell’s Blog http://blogs.msdn.com/b/russmax
Microsoft References SPMonitoredScope Class
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.spmonitoredscope(office.14).aspx
Using SPMonitoredScope Class http://msdn.microsoft.com/en-us/library/ff512758.aspx
Download links http://spflogger.codeplex.com Microsoft SharePoint 2010 Administration Toolkit v2.0
![Page 34: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/34.jpg)
Did you really take these pictures?
![Page 35: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/35.jpg)
![Page 36: SharePoint Logging and Debugging: The Troubleshooter’s Best Friend by Jason Himmelstein - SPTechCon](https://reader035.vdocument.in/reader035/viewer/2022081507/55511e91b4c905f10b8b5428/html5/thumbnails/36.jpg)
Jason’s contact & vitals Microsoft vTSP
virtual Technology Solutions Professional SharePoint Foundation Logger
http://spflogger.codeplex.com Web: www.sentri.com Blog: www.sharepointlonghorn.com Twitter: @sharepointlhorn LinkedIn: www.linkedin.com/in/jasonhimmelstein
Author of Developing Business Intelligence Apps for SharePoint http://bit.ly/SharePointBI