Powershell Week – Day 5: Viewing and Setting SharePoint Diagnostic Logging levels using Powershell
June 22, 2012 Leave a comment
Whenever you install a new SharePoint farm you might go thru that annoying task of setting the ULS and the Event Log levels. This is one of the moments our friend Powershell can give us a good hand.
Follow a few scripts to help you check your current settings and set new values for entire areas or specific sections.
List the main areas of the Log configuration:
get-sploglevel | select-object area | sort-object -property 'area' -unique
List the details of all the areas of the Log configuration:
get-sploglevel | format-table area , name
List the configured log level for one specific area:
get-sploglevel -identity "SharePoint Server:*" | format-table name, eventseverity, traceseverity
Set the log level as Error for the Event Log and Monitorable for the ULS log for one specific area:
set-sploglevel -identity "SharePoint Server:*" -eventseverity Error -traceseverity Monitorable
My suggestion is for you to analyze which services you use on your farm and define the log levels according the importance of the services for your implementation. There is nothing wrong with settings only high severity events on the log if you don’t monitor it regularly and only want to see major issues. If you have a situation where it is important to have the logs in more detailed level, you can set the logs to different levels only when debugging and set it back to the regular level after the issue is solved.