Analyzing SharePoint logs has never been an easy task. Though there are tools available for better reading of logs, huge log files can always give you some pain and extra efforts.
What to do when the log file is very huge in size. Is there a way to create a new fresh logfile whenever required? The answer is Yes!
New-SPLogFile PowerShell cmdletWhenever you feel the current log file is getting large (even a few MBs), use the New-SPLogFile command to generate a new log file quickly.
Just open SharePoint Management Shell as administrator (right-click - run as administrator) and type below command
Syntax |CBS||New-SPLogFile [-AssignmentCollection <SPAssignmentCollection>]where AssignmentCollection is an optional parameter which manages objects for the purpose of proper disposal.
Example: New-SPLogFileSo simple, yet very handy command.
This is not an AI-generated article but is demonstrated by a human.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!