Tailing Live Log Files
This guide sets up Vaste to follow a log file that a server or another program is writing: new lines appear as they arrive, and a notification tells you when a new line matches a search, such as an error.
Before you start: have a log file that a program is writing to, for example a server’s app.log. Vaste reloads files automatically by default.
Follow the log
Section titled “Follow the log”-
Open the log and check Auto reload
Open the file. The status bar shows Auto reload on. If it shows Auto reload off, turn on the Auto reload setting, in the General settings under File changes. See Settings.
-
Go to the end
Press
Endto show the last lines of the file. -
Watch new lines arrive
When the program adds lines, Vaste reloads the file as soon as the writing pauses, or at least every 2 seconds while it continues, and shows a notification such as 12 new lines with Jump to new content. In Text view, a green bar marks the new lines for 30 seconds, and a marker beside the scrollbar shows where they start.
Vaste does not scroll to new lines by itself, so you can read earlier lines without the view moving. To see the latest lines, select Jump to new content or press End.
Get an alert for new errors
Section titled “Get an alert for new errors”Set up a saved filter with an alert, so Vaste tells you when new lines match it. See Saved filters and alerts.
-
Search for what you want to watch
Press
Ctrl + F, typeERROR, and pressEnter. -
Save the search as a filter
Select More actions (
…) in the search panel, then Save. Typeerrorsas the name and pressEnter. -
Turn on the alert
Select Saved (1), then the bell next to
errors. Its tooltip changes to Alert while tailing is on. -
Wait for new errors
When new lines that contain
ERRORarrive, a notification such as 2 new matches for ‘errors’ appears in place of the new-lines notification. Select Jump to go to the first of them in Text view.
The alert searches only the lines added since the last reload. It keeps working for every file you open, until you turn the bell off.
Read matching lines while the log grows
Section titled “Read matching lines while the log grows”Each reload clears the search results and closes Grep view, so with Auto reload on, Grep view closes each time the log changes. To read the matching lines without interruption:
-
Turn off the Auto reload setting.
-
Run your search and open Grep view with
Ctrl + Shift + G. -
When you want the latest lines, press
Ctrl + Rto reload, then pressEnterin the search panel to search again.
While Auto reload is off, alerts run only when you reload with Ctrl + R.
When the log is rotated
Section titled “When the log is rotated”Many servers rotate their logs: they rename the current file and start a new one with the same name. When this happens, Vaste reads the new file in full and shows File changed on disk with the file’s line count. No new-lines notification or alert appears for that reload, and Vaste marks pinned results as stale.
If the file is deleted, Vaste shows Reload failed: I/O error and keeps showing the last content it loaded. See Deleted and rotated files.
Logs that always reload in full
Section titled “Logs that always reload in full”Some reloads read the whole file instead of only the added lines: for a log encoded as UTF-16, for a compressed log such as app.log.gz, and when a lot was added at once. These reloads show File changed on disk instead of the new-lines notification, and alerts do not run for them. See Live reload and Compressed files.
Next steps
Section titled “Next steps”- Live reload: what a reload keeps and what it clears
- Saved filters and alerts: manage filters and alerts
- Investigating a log incident: narrow a log down to the lines that matter