Adding Logs to the Mac OS X Console
Console.app is a really nice, simple application that displays log files updated in real time. I often keep multiple terminal windows open with tail -f running on some log file to keep track of various applications. There are some nice advantages to using Console over tail:
Console comes pre-configured to display logs in several standard locations. But if you install new applications like application or web servers, their logs may not be written to one of the standard locations.
The easiest way to add log files to Console is to symlink the directory they're in to one of the standard locations, which are:
In my case, tomcat writes its logs to /Applications/jakarta-tomcat-5.0.28/logs. To get these logs to appear in Console:
- filter output so only lines containing particular text (like ERROR) are displayed
- insert a marker so you can see what was written after a certain point
- clear the output
Console comes pre-configured to display logs in several standard locations. But if you install new applications like application or web servers, their logs may not be written to one of the standard locations.
The easiest way to add log files to Console is to symlink the directory they're in to one of the standard locations, which are:
- /var/log
- /Library/Logs
- ~/Library/Logs
In my case, tomcat writes its logs to /Applications/jakarta-tomcat-5.0.28/logs. To get these logs to appear in Console:
- Open a Terminal window (/Applications/Terminal)
- Type ln -s /Applications/jakarta-tomcat-5.0.28/logs ~/Library/Logs/tomcat
- If Console is open, quit and re-open it.
Labels: os x