New-SPLogFile PowerShell Cmdlet in SharePoint Troubleshooting

New-SPLogFile cmdlet in SharePoint 2013 creates a new ULS trace log file on execution. In other words, once you execute this New-SPLogFile command, it ends the current log file and creates a new log file. All subsequent errors will be placed in the new log file, which intern greatly helps to isolate all new errors.

It’s a good idea to start a new log file when you troubleshoot any issues in SharePoint as identifying current issues from existing logs could be cumbersome while existing log files can become large and difficult to scan through. Here is how you can utilize New-SPLogFile cmdlet.

  • Go to SharePoint PowerShell Management Shell
  • Type: New-SPLogFile and hit enter. It doesn’t have any parameters.
  • Now, your new trace log file will be created. Once the new log file is created, you can trigger the event that is causing issues.
    New-SPLogFile PowerShell command
  • Get your trace log location from the diagnostic log path. Go to: Central Administration >> Monitoring >> Configure diagnostic logging >> Trace Log Path
    powershell new-splogfile sharepoint
  • Go to the trace log location, sort using created date, and there you’ll find your new log file created! Open it to start your troubleshooting.

Technet reference on New-SPLogFile

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply