I'm trying to use Console.app to debug some problems on my Mac. I've cleared out the log files from inside /Library/Logs
and ~/Library/Logs
but I still have around 4000 messages left! I tried the Clear Display button but that only clears the application temporarily.
2 Answers
Clear the logs in /private/var/log - especially system.log. That file gets quite large. Then delete data in Macintosh HD/Users/"your user name"/Library/Logs. Delete everything in there. Next, go to Macintosh HD/Library/Logs and delete everything in there, too. It's safe to delete these log files and will not affect system performance.
-
Nice! I did have to delete everything inside of /private/var/log - even the archive files, but then it worked. Thanks!– cwdFeb 15, 2011 at 17:27
-
Basically, it sums up to this:
- Applications can use the syslog API (bsd_in) and the asl API (asl_in) to log messages by handing them over to the syslog daemon (syslogd). Other data that gets logged can come from the kernel (klog_in) or from the network (udp_in).
- All of these messages are handled by syslogd, which outputs log messages both the BSD way (bsd_out: it writes stuff into various basic log files like /var/log) and into a unified log message store (asl_action: the message store is in /var/log/asl/*).
- Console displays both kinds of logging facilities: "classical" log files and database searches. Even if you delete all .log files, the database is still intact and full of entries.
Also, if you want to troubleshoot, there should be no need to clear old log files, you will only have to be more specific over what you want to read from the log. A good starting point would be using "syslog" (not syslogd!) from the command line, where you can parse logs with more specific instructions (have a look at man syslog). So if you were to parse all messages logged by Safari in the last 5 hours you would run:
syslog -k Facility -k Time ge -5h -k Sender Safari
or to see all messages, but not those of Mail:
syslog -k Facility -k Sender ne Mail
Trust me, even though this might look confusing, it´s far better to read logs on the command line than in Console.app
But if you want to keep on using Console you still might want to checkout the man page for aslmanager and syslog.conf to see how you can eg. configure where the files are kept, for how long, and how to archive them.
tail -f /var/log/logname
to watch it...