By using Console and Finder, you can clear your Mac Startup Disk of old logs and crash reports to save space. Here's how to do it.
In macOS, the operating system stores logs and crash report files in a variety of locations. Third-party logs are also stored.
Once in a while, you'll want to clean these out and delete them in order to free up space on your Startup Disk.
Where log and crash report files live on a macOS Startup Disk
- /Library/Logs
- /Users/UserName/Library/Logs/
- /private/var/log
Where Diagnostsic reports live on a macOS Startup Disk
- /Library/Logs/DiagnosticReports
- /Users/UserName/Library/Logs/DiagnosticReports
Also, note that some logs maintained by the system are restricted and you shouldn't delete them under any circumstances. In general, any restricted folder which contains a small red icon on its corner in the Finder is system-restricted and shouldn't be touched.
Some of the system logs are maintained continuously by system daemons, so even if you delete them, the system will recreate them instantly. But by deleting them you still clear out old log data.
The /private/var/log folder is hidden by default in macOS, and to be able to see it in Finder, follow the instructions we discussed previously in How to use invisible files in macOS.
If you are running the Apache web server on your Mac, it stores its log file in /private/var/log/apache2/. Don't delete this folder or anything in it. If you do, Apache won't automatically recreate the log file for you and it won't log any message or errors once the log file located here disappears.
Clearing logs and crash reports
If you have an admin password, you can open these directories and delete the logs yourself, but there is an easier and safer way: use the Console app located in /Applications/Utilities/.
Run the app by double-clicking it, and on the left side, you'll see four items of interest:
- Crash Reports
- Log Reports
- Diagnostic Reports
- system.log
First, single-click on Crash Reports on the left, then Control-click or right-click on any set of items in the list on the right, and select either "Move to Trash" or "Reveal in Finder":
Selecting Move to Trash moves the selected items to the Trash but doesn't delete them from the disk yet.
Selecting Reveal in Finder opens the enclosing folder containing the items where you can view them first.
The process is the same for the "Log Reports" item, except that selecting "Reveal in Finder" opens the specific enclosing folder for each log file instead of /Library/Logs or /Library/Logs/DiagnosticReports.
For "system.log", single-clicking merely displays the log contents on the pane to the right. To reveal it in Finder, you'll need to Control-click or right-click the item name itself on the left. This opens the /private/var/log folder and highlights the item.
To remove system.log and most of the other items in /private/var/log, you'll need to Control-click or right-click them and select "Move to Trash" from the popup Finder menu.
For subfolders in /private/var/log, (except for "apache2" ) don't delete the folders, but instead, open each one and delete its contents. In many of these folders, the system will automatically back up the last few iterations every few hours by duplicating and renaming them. In most cases, you can delete the duplicates as well.
You may need to enter an admin password for Finder to move the files to the Trash.
For some of these subfolders, such as "asl" or "mDNSResponder", you don't really need to delete anything.
Once all of the items you want to remove are moved to the Trash, select "Empty Trash" from the Finder menu in the menubar. You may also want to Restart your Mac for completeness and to force any running background daemons to reset themselves.
Additional lurking logs
There are a few other places on the Startup Disk where log files hide out. Namely:
- /Library/Application Support/CrashReporter
- /Users/UserName/Library/Application Support/CrashReporter/
If you are using Apple's Xcode developer tools, there are also large caches and log folders at /Users/UserName/Library/Developer/Xcode
The system also maintains a large application files cache at /Users/UserName/Library/Caches/.
In most cases, you can safely delete items in this folder, but you may want to quit all running applications first and do some research on third-party cache items before deleting them to make sure you're not deleting something important.
You may also want to restart your Mac after deleting items in the Caches folder. This folder can sometimes run into gigabytes in size over time.
Additional application data is sometimes stored in /Users/UserName/Library/Containers/, and if you later remove any third-party apps from your Mac you can also remove the folder for each application from the Containers folder as well.
By keeping your Startup Disk free of old logs and caches, you can both save space and make reading log files easier.