how to increase the wss_logging database retention period to store uls log files from default 14 days.

1 Answer 1


Have a look at the following MSDN article: https://blogs.msdn.microsoft.com/manhar/2012/04/17/how-to-reduce-the-size-of-logging-database-or-how-to-purge-the-old-data-from-logging-database/ it will answer your question. The title says how to decrease the size of the logging database, but the article describes how to change the retention periods.

An example command:

Add-PSSnapin Microsoft.SharePoint.PowerShell
Set-SPUsageDefinition -Identity ”Page Requests” -DaysRetained 3

This will set retention period to 3 days for "Page Requests":

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.