Here's a quick tip that is a real time saver in some situations. As a developer you often come across programs, tools or servers that produce output in form of a log file. Or maybe - and this includes myself - you use logs for debugging purposes.

In ColdFusion for example I regularly find myself adding cflog tags to my code in order to get a view into what my code is doing. Having to open and close log files constantly can be tedious at best, but luckily there is a really simple way of displaying a live view of the most recent entries using the standard Unix tail -F command.

Whereas tail on its own simply displays the last part of a file, the -F option will not stop when the end of the file is reached but will keep monitoring the file for new lines and displaying them, thereby giving you effectively a live console view into the file.

Taking ColdFusion logs as an example, here's how you'd monitor a particular log file (mine are typically named according to the site or application I am working on):

view plain
1cd /Applications/ColdFusion9/logs/
2tail -F playingornot.log

As my application runs I can see new entries being displayed in real time in my log file - very handy. This particular log is produced by adding

view plain
1<cflog file="" type="information" text="#arguments.targetPage#">
to my Application.cfc's OnRequestStart handler.

This technique works for any kind of text based log file on operating systems that have the tail command or similar available.