The file is not called the same thing today

Tail4win » Use cases » Rotated logs

Download Tail4win Free Trial »     Buy Tail4win Now »

The situation

Most servers do not write one endless log. They write one file per day, or per hour, and the name carries the date: catalina.2024-06-01.log, app.%yyyy%-%mm%-%dd%.log, an IIS log directory with a file per day. Following that is more than following a file: at midnight the file you opened stops growing and a new one starts, and yesterday's task opens yesterday's log.

The same is true of a session saved today and loaded next month.

What you do

  1. Use Open Special File rather than opening a fixed file.
  2. Write the name as a pattern with date placeholders - %yyyy (year), %mm (month), %dd (day), %hh (hour) - for example logs\catalina.%yyyy%-%mm%-%dd%.log.
  3. Tail4win resolves the pattern for the current date, so opening it tomorrow opens tomorrow's file.
  4. Save it in a session: the session keeps following whichever file the pattern points at, instead of a name that is already stale.

Opening a log file with a date pattern in Tail4win's Open Special File dialog

This is what makes a saved task survive: a session built around a pattern is still correct next week, and a command-line call with the same pattern can be scheduled without editing it. It is also the difference between watching a log and watching the log archive grow.

What it will not do

Related

Following a plain file: watching a live log. Servers that rotate: Tomcat, IIS, Apache, MySQL. Repeating it: sessions, command line. Narrowing the stream: filter, highlight.