Following a rotating log
A log rotates: app.log is renamed to app.log.1 and a new app.log is written (later the old one becomes
app.log.2.gz), or a new file is started every day or hour with the date and time in its name - app_2026-10-14.log,
then app_2026-10-15.log; log2026101422.txt, then log2026101423.txt; IIS writes u_ex261108.log, then
u_ex261109.log - or app.log keeps its name while each finished file is renamed with its date and time
(app-2026-10-14_23-00.log). In TKTail one tab follows the log, not yesterday’s file name: when the log rotates, the
same tab moves on to the new file. You do not have to find and open the new file yourself, and tabs do not pile up.
The rotation mark
A tab that follows its log’s rotation shows the rotation mark (a circular arrow) before its name:
| Mark | Means |
|---|---|
| Rotation mark | The tab follows the log: when it rotates, the tab moves on to the new file. |
| Rotation mark with a dot | The tab shows another file than the log’s current one - you are reading a previous file, or a new file arrived while you read. Go to Current Generation moves it on. |
| Pin | A pinned file: this tab stays on this one file. |
Hover the tab: it says Following file rotation, the current file and the previous one. Click the mark - or right-click the tab > Rotation History… - for the rotation menu.
When the log rotates
- The tab was LIVE (following the end): the same tab shows the new file, LIVE at its end - in the same place, with
the same View As format (a Custom Format Studio profile too), encoding, refresh mode, word wrap, line numbers and Find
text. The status bar says
Switched to app_2026-10-15.log - the previous file, app_2026-10-14.log, is closed once its last lines are read: TKTail reads the writer’s last lines of the previous file (and your alerts check them), then closes it. A file another tab shows - a pinned one - stays open there. - You were reading (the tab PAUSED, scrolled back): TKTail never moves you. The tab stays where you are, its mark gets a dot, and the status bar says which file is current now. The new file is watched in the background meanwhile - alerts run on it. Go to Current Generation (the rotation menu, or right-click the tab) moves the tab to it, LIVE.
- The new file is empty when it appears (it usually is): the tab follows it anyway, and the format carries on (see below) until the new file’s own content says what it is.
- Several new files at once (a share that was away overnight): the tab goes straight to the newest one.
- The same name (
app.logrenamed toapp.log.1- or toapp-2026-10-14_23-00.log,app.log.2026-10-14, the date and time of the file it was - and a newapp.logcreated): the tab continues with the newapp.log; the status bar names the previous file. To stay with the renamed file instead: Stop Following Rotation. - 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 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.*). - After a restart, a tab that followed its log opens the log’s newest file - also when it showed a previous file when TKTail closed. Yesterday’s file is never reopened as if it were the live one.
The rotation menu
Click the rotation mark:
- The current file (Current), then the previous files, newest first by what their names mean - the date, the
time, then the number, never alphabetically (
app.log.10is older thanapp.log.9;..._2359.logcomes before the next day’s..._0001.log). Each shows its place on the right (2026-10-14 23:00,#2); compressed ones by their names (app.log.2.gz,u_ex261107.log.gz). Click a previous file to look at it in this tab (Trial / Pro); the tab’s mark gets a dot, and Go to Current Generation - the current file’s line at the top of the menu - takes you back. The current file keeps running in the background meanwhile (its alerts too). - Open a Previous File in a New Tab - that file in a tab of its own, pinned (every edition).
- Pin This Generation - the file this tab shows now, in a tab of its own that never moves; the series tab keeps following the log. Useful in an incident: keep yesterday’s file pinned while today’s runs on.
- Search the Rotation History… (Trial / Pro) - Advanced Search with the log’s history as one source: the current file and its previous files, compressed ones too, each read once - one search, one aggregation, evidence from several files (Compressed files and archives).
- Stop Following Rotation / Follow Rotation - this tab only.
How many previous files the menu lists: Settings > Monitoring > Rotation history (Trial / Pro; Free lists the previous file). TKTail reads only the file names in the folder to list them - it opens none of them.
Free and Trial / Pro
Free follows the current log. Trial and Pro turn its previous files into an investigation history.
| Free | Trial / Pro | |
|---|---|---|
| The tab follows the newest file - in the same tab, the previous file closed once its last lines are read | yes | yes |
| The rotation mark, Go to Current Generation, never moved while you read | yes | yes |
| The rotation menu lists | the previous file | the rotation history (default 7 files) |
| A previous file in a tab of its own; Pin This Generation | yes | yes |
| A previous file inside the series tab | - | yes |
| Searching, aggregating and saving evidence across the log’s files (its history) | - | yes |
| AI clients: a log’s history (AI integration) | - | yes |
The rotation history is not a folder search
A folder search (Advanced Search > a folder, app*.log*) finds every file whose name matches - but it does not know
what the files are. The rotation history does: which file is current, the order of the previous files (by date,
time and number - not by name), that app.log.1 and app.log.1.gz are one file kept twice, and which files belong
to another log (app-server-2026-10-14.log next to app-2026-10-14.log). That is what the tab follows, what an alert
continues in, what Search the Rotation History… reads (each file once, oldest first), what a restart reopens and
what evidence names. Use the rotation history to investigate a log; use a folder search to look across different logs.
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, app.log.1, app.log.2.gz, …, app.log.10 | numbered: a higher number is older; app.log is current |
app.log.20261014, app.log.20261015 | by date |
app_20261014_2300.log, app_20261014_2359.log, app_20261015_0001.log | by date, then time - 23:59 before 00:01 the next day |
app_2026-10-14_23-15-00.log, app_2026-10-14T23-15-00.log | date and time with the colons replaced (ISO-like) |
log2026101422.txt, log2026101423.txt | the date and the hour in one number (Serilog hourly; also YYYYMMDDHHmm, YYYYMMDDHHmmss) |
app.log.20261014.001, app.log.20261014.002, app.log.20261015.001 | by date, then the number - which starts again the next day |
log20261014.txt, log20261014_001.txt, log20261014_002.txt, log20261015.txt | the day’s first file has no number (it is number 0), the next ones count from 001 (Serilog’s size limit) |
app_20261014_2300_1.log, app_20261014_2300_2.log, app_20261014_2315_1.log | by date, time, then the number |
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 |
20261014_app.log, 20261014_2300_app.log | the date (and time) before the name |
001.app.log.2026-10-14, 002.app.log.2026-10-14 | a number before the name, the date at the end |
app.log with app-2026-10-13.log, app-2026-10-14_23-00.log.gz | a fixed current name: app.log is the newest, the renamed files are its history by their date and time (log4j, logback, NLog archives - app.log.2026-10-14, app.20261014.log too) |
| 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 (2026101423, 202610142359, 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. |
| Compression | A previous file compressed to .gz, .zst, .xz, .bz2 or .lz4 is the same file of the series (app_20261014_2300.log.gz); the same file kept twice counts once - the plain one first, then gzip, zstd, xz, bzip2, lz4. A .zip is an archive of its own, never a file of the series (Compressed files and archives). |
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 - with one exception: IIS log files (u_ex261105.log,ex261105.log, thein/ncvariants, hourlyu_ex26110509.log) are recognized by that exact shape, the year being 20YY. An alert can name any other such series with a pattern of its own (svc{YYMMDD}.log- AI integration). - 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. - Timestamps (Unix seconds in a name,
app_1762729200.log): a ten-digit number looks like any other id, so it is not read as a time; such files are not followed or ordered as a series. - 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 in the rotation history | 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.
- Last switch and Folder (how the folder is watched).
Opening an older file of a series yourself (yesterday’s while today’s exists) means you want to read yesterday: TKTail stays on it (the Inspector names the newer file); choose On to follow the series from there.
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 - also while you read a previous file in the tab. Incidents name the file the line was really written to; looking at a previous file never fires an alert for its old lines. - Also without a tab, also after a restart. An alert made while the file followed its series (Add Alert, or an AI client) keeps the series in its definition: TKTail keeps the newest file of it watched in the background - with the tab closed, hidden in the notification area, and after a restart, when the next day’s file has appeared in the meantime. Tools > Manage Alerts shows the file each alert reads now (Yes - app_2026-10-15.log (no tab)). An alert made on a file that was not followed stays on that one file - a date in a name alone never changes what an alert watches.
- 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.
- Before an older file is deleted: a search’s results are kept with Save as Evidence - an evidence package names each file by its identity, not only its name, and stays valid after the file is gone (Saving evidence).
- 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) - a tab opened on the newest file of a dated log follows it; a file opened as an older one, or pinned, never does.
- Rotation history: previous generations listed (default: 7, from 0 to 50; Trial and Pro - Free lists the previous file). Previous files are never kept open as tabs.