New-SPLogFile cmdlet in SharePoint 2013 creates 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.
Its a good idea to start a new log file when you troubleshoot any issues in SharePoint as identifying current issue 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 has 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.
- Get your trace log location from diagnostic log path. Go to: Central Administration >> Monitoring >> Configure diagnostic logging >> Trace Log Path
- 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.
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.