Rotating dated log files
Many applications start a new log file every day, hour or minute and put the date in its name:
app_2026-10-14.log, then app_2026-10-15.log. TKTail treats these files as one log. When the
next file appears, TKTail opens it beside the current tab and keeps it LIVE. You do not have to
find and open the new file yourself.
How it works
- Open the newest file of such a series. File > Open, Explorer’s “Open with TKTail”, drag and
drop, Recent and
tktail openall work the same way. TKTail reads the name and compares it with the other names in the folder. It reads names only and opens no other file. - When a newer file of the series appears, it opens in a tab next to the current one, in the
same pane, and becomes LIVE. These choices carry over to the new tab:
- View As (also a custom format)
- encoding
- refresh mode
- word wrap, line numbers and observation times
- The status bar says
SERIES → app_2026-10-15.log. While a tab follows its series, its LIVE marker readsLIVE · SERIES. - The format carries on. A format you chose with View As (a custom format too) carries to the next file. A
format TKTail detected carries too while the new file - often empty when it becomes LIVE - has too little content to
tell (the Inspector says Previous file of the series); once it has, its content decides. A custom format associated
by extensions looks at the last extension of each name (
.001forapp.log.20261014.001): for such names, associate it by file names (app.log.*). - Who comes to the front: the new file does, if the series tab was in front and LIVE. Otherwise nothing takes the focus. If you paused the old file to read it, it stays where you are, and the new file is LIVE in the next tab.
- The previous file:
- In Free, the previous file closes once nothing has been written to it for a few seconds.
- Trial and Pro keep previous files open next to the LIVE one, oldest on the left. Set how many in Settings > Monitoring > Previous files of the series kept open (default 2).
- TKTail only closes tabs it opened for the series. A tab you opened yourself is never closed.
- Opening an older file of the series (yesterday’s while today’s exists) means you want to read yesterday, so TKTail stays on it. The Inspector names the newer file. Choose On (see below) to follow the series from there.
- Order comes from what the name means: date, then time, then number.
_9comes before_10, and31-10-2026before01-11-2026. TKTail never uses alphabetical order or file times. Some cases are handled specially:- A file with an older date copied into the folder never moves LIVE backwards.
- A file dated more than two days after today is ignored and noted in the application log.
- When several new files appear at once (for example a share that was away overnight), TKTail goes straight to the newest one.
- After a restart, a tab that was following its series opens the newest file of the series.
Names TKTail recognizes
TKTail reads the whole file name, not a name plus a fixed extension. The date, the time and the number can be
anywhere - at the start (2026-10-14-api.log), in the middle (api-2026-10-14-part.log), before the extension, or in
what Windows calls the extension:
| Files | One series, in this order |
|---|---|
app.log.20261014, app.log.20261015 | by date |
app.log.20261014.001, app.log.20261014.002, app.log.20261015.001 | by date, then the number - which starts again the next day |
app.20261014.log.001, app.20261014.log.002 | the date before .log, the number after it |
app_2026-10-14.log.9, app_2026-10-14.log.10 | 10 after 9: numbers are compared as numbers |
app.log.20261014.235959.001 | date, time and number, all after .log |
001.app.log.2026-10-14, 002.app.log.2026-10-14 | a number before the name, the date at the end |
| Part | Forms |
|---|---|
| Date | YYYYMMDD, YYYY-MM-DD, YYYY_MM_DD, YYYY.MM.DD, DD-MM-YYYY, DD_MM_YYYY, DD.MM.YYYY. Month and day may have one digit (2026-9-9). Each date is checked against the calendar: 2026-02-29 and 2026-19-44 are not dates. |
| Time (optional, right after the date) | HHmmss, HHmm, HH, HH-mm-ss, HH_mm_ss, HH.mm.ss, HH-mm, HH_mm, HH.mm. Joined to the date by -, _, ., T or a space, or written straight after it (20261014235959). Hours, minutes and seconds are checked. Windows file names cannot contain :. |
| Number (optional) | A number on its own, between _, -, ., spaces or brackets, or at the start or end of the name. Also a number after part, seq, segment, chunk or roll. Examples: app_2026-10-14_1.log, 001_app_2026-10-14.log, app_2026-10-14.0001.log, app_2026-10-14_part2.log, app.log.20261014.009. Leading zeros do not matter. The number can start again from 1 each day. |
A number counts as the rotation number only once the folder shows it changing between files of
the same date. Until then it is part of the name: app_2026-10-14_123.log alone could be a shard
or a process id. A number attached to a word, such as server01, port1433 or node2, is always
part of the name.
Everything else in the name must stay the same - also the text around a dated suffix:
app_debug_2026-10-15.log,database_2026-10-15.logandapp_2026-10-15.zipare not the next file ofapp_2026-10-14.log;app.zip.20261014.002andbackup.log.20261014.002are not the next file ofapp.log.20261014.001.- Letters compare as Windows compares file names: case does not matter. Names in any language
work (
zamówienia_2026-10-14_łódź.log).
When TKTail does not follow by itself
TKTail would rather not follow than follow the wrong file. These names are not followed automatically:
- Two-digit years and six-digit dates (
14-10-26,261014) are not read as dates. - Month-first dates (
10-14-2026): TKTail reads day-first. If the folder holds names that only make sense month-first, the series is reported as ambiguous. - Two dates in one name, or two numbers that both change, when the folder does not show which one rotates. Choose the reading yourself: Inspector > Dated rotation > Pattern lists every reading of the name.
- Names with a number and no date (
app.1.log,001_app.log): logging libraries number such files both ways (app.1.logis the newest for one and the oldest for another). The usual case, a fixed name likeapp.logthat is replaced, is covered by ordinary rotation. - A name that only sometimes has a number (
app_2026-10-14.log, thenapp_2026-10-14_1.log): TKTail follows files shaped like the one you opened. - Numbered files written at the same time (shards such as
app_2026-10-14_01.logand_02.log, both growing) look like a sequence. Set the file to Off, or choose the reading without the number.
Per file: Auto, On, Off
Click Dated rotation in the Inspector’s TKTail section, or the Dated Series section’s rows:
| Choice | What it does |
|---|---|
| Auto | Follows when the name is clearly dated and you opened the newest file, while Settings > Monitoring > Follow dated file rotation automatically is on (it is by default). |
| On | Follows this file’s series, even with that setting off, and moves to the newest file now. |
| Off | Stays on this file. |
| Pattern | Detected automatically, or one of the readings of the name, shown like app_{YYYY-MM-DD}_{N}.log. |
| Previous files kept open | Trial / Pro: Default, or 0, 1, 2, 3, 5 or 10 for this file. |
The choice stays with the tab, also after a restart.
The Dated Series section shows:
- Mode and State, and Why when the file is not followed.
- Pattern, with where it came from: from the name only, confirmed by the files in the folder, or chosen by you.
- Current: the date, time and number of the LIVE file.
- Next file: Waiting, or the file being opened. TKTail retries while the writing application still holds the file.
- Previous files kept, Last switch, and Folder (how the folder is watched).
A previous file TKTail keeps open says so and names the LIVE file.
Free and paid editions
Following the series works in every edition. Keeping previous files open beside the LIVE one needs a Trial or Pro license. In Free the previous file closes when the next one is LIVE, and the setting is shown as unavailable.
Alerts, incidents and monitoring
- An alert follows the series. An alert made on
app_2026-10-14.logwatchesapp_2026-10-15.logonce that file is LIVE, so you do not have to edit it every day. Incidents name the file the line was really written to. - Evidence across a switch: records after the trigger continue in the next file of the series, and records before it come from the previous one. Each file is kept as its own part of the evidence, with its name. Positions are never mixed between files.
- A monitored file (Monitor in Background,
tktail monitor add) follows its series without a tab. From then on the monitored entry names the current file.
Files on network shares
A series on a share is watched like the share’s files:
- TKTail uses notifications where the share sends them. Otherwise it checks the folder at the file’s refresh mode, at most every 2 seconds.
- While the share is away, nothing waits for it.
- When the share answers again, TKTail goes to the newest file of the series.
See Huge files and network shares.
Settings
Settings > Monitoring > Dated file names:
- Follow dated file rotation automatically (default: on).
- Previous files of the series kept open (default: 2, from 0 to 50; Trial and Pro).