Click here to Skip to main content
Click here to Skip to main content

Tail for Win32 - A Windows version of the Unix 'tail -f'

, 26 Nov 2003
Rate this:
Please Sign up or sign in to vote.
I had searched for what seemed like an eternity for a Windows version of the 'tail -f' command - a way to monitor logfiles as they change in realitime. Having not found one, I decided to write my own. Tail for Win32 is the result of hundreds of evenings' work to achieve just that.

Introduction

Ever wanted to just type 'tail -f error_log' on Windows?

Envious of your Unix friends who can track changes to a file, in real time, as they happen?

Well, now with the Objektiv Tail for Win32, you'll be happily monitoring your log files like you've never done before.

What's even better, you can track several files all at the same time with the patented "Multiple Document Interface"TM technology, with each file having its own, fabulous window.

What is it?

Tail for Win32 is a Windows version of the Unix 'tail' utility. It can be used to monitor changes to a text file in real time - ideal for watching error logs.

The program was written in C++ using MFC, and uses Win32 file change notifications to monitor when a file changes.

The application uses a 'plug-in' architecture, under which all changes are passed through external DLLs that can perform various functionality.

The first plug-in is an SMTP filter. This DLL sends emails via SMTP when a keyword is found in the file being monitored.

And?...

As well as monitoring files in real time, you can also specify a set of 'keywords' that tail looks out for. When a keyword is encountered, it can be 'syntax' highlighted in a number of optional colors, and can also fire external plug-ins. This is all configurable on the fly.

The program can also be told to ignore any lines that do not contain the keywords specified; only showing 'hot' lines.

So How Does it Work?

At the core of the application is the Win32 file notification API. This API fires an event whenever a file changes in a directory. Using this event, we can track whenever changes are made to a particular file.

For each file that is monitored, a thread is set up that blocks on the firing of the file notification. This makes the application extremely efficient - it only ever does anything when a file actually changes.

This is all written in MFC under Visual Studio 6. But compiles quite happily under .NET and .NET 2003.

The following controls are used to a greater or lesser degree:

  • RichText control -version 2.0 to allow background shading
  • ListView control - with checkboxes and combo controls
  • Tree control - subclassed to handle double-clicks and right-clicks

Can I Help?

Yes, please!

The project is hosted on SourceForge, so CVS access is all part of the deal. If you think you'd like to help and can contribute even a few minutes of your time, please do get in touch!

The project homepage is: here and the CVS repository is updated at least daily, so please do check back on a regular basis.

License

Tail is released under the GPL. In a nutshell, you can do whatever you like with the source, so long as if you pass on the application for free or for profit, you must also pass on the source.

Updates

  • 4.2.7: Tally window fix. Added background and highlight colour dialogs. Slight re-jig of the object model.
  • 4.2.6: Fixed a couple of bugs with the Tally window and the Keyword configuration window.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Paul Perkins
Web Developer
United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
GeneralLove the tool - how 'bout command line options Pinmemberbkeadle3-May-10 13:29 
QuestionCan anyone fix two issues with 'Pause' ? Pinmemberehaerim5-Dec-09 11:29 
GeneralAdded support for workspaces PinmemberSnakefoot24-Sep-09 6:11 
Generaltail mail text Pinmemberalberto di venti24-Jul-09 5:14 
GeneralRe: tail mail text Pinmemberalberto di venti24-Jul-09 12:17 
Generalserious bugs Pinmemberehaerim18-Nov-08 20:48 
GeneralRe: serious bugs [modified] Pinmemberehaerim18-Jun-09 3:15 
GeneralTailing doesn't works under Vista. Pinmemberrockaden13-Oct-08 7:01 
GeneralRe: Tailing doesn't works under Vista. PinmemberDavid 'dex' Schwartz22-Feb-13 17:16 
GeneralRe: Tailing doesn't works under Vista. PinmemberDavid 'dex' Schwartz22-Feb-13 17:18 
QuestionHow do I get Tail to tally from the begining of a file? PinmemberPeterMLee669-Nov-07 9:33 
Generalplugins not showing up PinmemberJavaReb16-Aug-06 8:35 
GeneralRe: plugins not showing up PinmemberXH_expanders27-Nov-06 11:28 
GeneralNice work PinmemberMatt_G20-Jun-05 7:48 
GeneralHm... PinsussAnonymous30-Dec-04 10:45 
GeneralReal time logging Pinmemberarkol10-Sep-04 12:05 
GeneralSupport for Unicode files PinsussAnonymous27-May-04 10:17 
GeneralRe: Support for Unicode files Pinmemberswalch30-Jun-04 5:50 
GeneralRe: Support for Unicode files Pinmemberallanmb27-Jun-06 5:42 
Generallog file roll-over PinmemberJazzak29-Mar-04 5:43 
General. net PinsussAnonymous5-Dec-03 3:04 
Generalroot-tail PinmemberChris Coote3-Dec-03 7:25 
GeneralPerfect timing Pinmemberdgroves3-Dec-03 5:08 
GeneralRe: Perfect timing PinmemberPaul Perkins3-Dec-03 7:38 
GeneralMonitoring event log PinmemberSascha Andres27-Nov-03 10:39 
GeneralRe: Monitoring event log PinmemberPaul Perkins27-Nov-03 11:04 
GeneralRe: Monitoring event log Pinmemberehaerim18-Jun-09 8:58 
Generalautomatic scroll PinmemberRob Hegt18-Nov-03 22:12 
GeneralRe: automatic scroll PinsussAnonymous18-Nov-03 22:19 
QuestionPlugin Architecture - More Notes ? PinmemberGarth J Lancaster14-Nov-03 14:09 
AnswerRe: Plugin Architecture - More Notes ? PinmemberPaul Perkins14-Nov-03 21:11 
GeneralRe: Plugin Architecture - More Notes ? PinmemberGarth J Lancaster16-Nov-03 10:10 
QuestionFor how long? PinmemberTom Hunter14-Nov-03 12:19 
AnswerRe: For how long? PinmemberPaul Perkins14-Nov-03 20:55 
GeneralRe: For how long? PinmemberLars [Large] Werner15-Nov-03 6:37 
QuestionWhy not just install unix utils for win32? Pinmemberector14-Nov-03 12:16 
AnswerRe: Why not just install unix utils for win32? PinmemberJörgen Sigvardsson14-Nov-03 15:22 
GeneralRe: Why not just install unix utils for win32? PinmemberPaul Perkins14-Nov-03 20:58 
GeneralRe: Why not just install unix utils for win32? PinmemberJörgen Sigvardsson15-Nov-03 0:53 
GeneralRe: Why not just install unix utils for win32? PinmemberPaul Perkins15-Nov-03 21:38 
GeneralRe: Why not just install unix utils for win32? PinsussAnonymous22-Nov-04 12:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 27 Nov 2003
Article Copyright 2003 by Paul Perkins
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid