Log File is Too Large to Open in Notepad
Description of Issue
I get the following error when opening a log file, "file is too large for Notepad."
Context
- Debug
- Log
- Notepad
- Windows
- Powershell
Cause
Occasionally a log will grow out too big if debugging was left on and become too large to open in Windows Notepad.Â
Resolution
- Navigate to the Log file and write down the location on the drive
- Open Powershell as an administrator
- Use the following command replacing the locations as necessary: Get-Content 'Location of the log file' -last 10000 > 'location of where you want the new file'
Example : Get-Content 'D:\munprod\logs\vm-spoidcds-6.log' -last 10000 > D:\last_10000 - Hit enter
- Navigate to the file you created and open in Notepad to see what the last 10000 lines look like.Â
If you find that there is no relevant information you can also try this command to get the first 10000 lines.
Get-Content 'Location of the log file' -first 10000 > 'location of where you want the new file'
Additional Information