End the Current Log File

Scenario/Problem: You want SharePoint to be finished with the current log file and start a new one.

Solution: Use the New-SPLogFile cmdlet.

The New-SPLogFile cmdlet stops the current log file and starts a new one. This is helpful if you are tracing an issue and do not need more entries in the log file or do not want any issues with the log file being in use. Simply issue the New-SPLogFile cmdlet without any parameters on the server where you want to start a new log file, as shown in Listing 4.15.

Listing 4.15. Start a New Log File

New-SPLogFile

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.