Log Levels & Highlighters
Vaste colors log files in two ways. Log-level colours tint each line by the level it mentions, such as ERROR or WARN. Highlighters color the text that matches your own patterns, such as a request ID or a host name. Both work in Text view and Grep view, and neither hides any lines.
Log-level colours
Section titled “Log-level colours”Vaste reads the start of each line for a log level and tints the whole line:
| Level words | Tint |
|---|---|
FATAL, CRITICAL, PANIC |
Red, as errors |
ERROR, ERR |
Red |
WARNING, WARN |
Yellow |
INFO |
Cyan |
DEBUG |
Gray |
TRACE |
Fainter gray |
The exact colors depend on the theme.
How Vaste finds the level
Section titled “How Vaste finds the level”- Vaste looks only near the start of the line. A level word that comes late in a long line, for example after a long prefix or deep in a JSON object, is not found, and the line is not tinted.
- Letter case does not matter:
error,Error, andERRORall count. - The word must stand on its own, not as part of a longer word.
[ERROR],ERROR:,level=error, and"level":"error"count.errors=0,ERROR_COUNT,Information, anddebuggingdo not. - If a line has several level words, the first one decides. A line such as
[info-thread] ERROR: disk fullis tinted asINFO. - A line that starts with
I,W,E, orFfollowed by four digits, as in Kubernetes and glog output (E0926 14:03:11.204 ...), is read asINFO,WARN,ERROR, orFATAL.
Short forms such as ERRO, WRN, DBG, and INF, and the words NOTICE and SEVERE, are not recognized. To color lines with those words, add a highlighter with the Whole line scope. See Highlighters.
Turn log-level colors on or off
Section titled “Turn log-level colors on or off”Log-level colors are on by default. To turn them off, select More actions (…) → Log-level colours, or turn off the Log-level colours setting. See Settings.
The active line, the current search match, and selected lines show their own background instead of the level tint. In Grep view, the matching lines are highlighted, so the level tint shows only on context lines.
Highlighters
Section titled “Highlighters”A highlighter is a rule that colors text matching a pattern. Highlighters only add color: they never hide lines. Use them to follow an ID, a user, or a host through a log while you read or search for something else.
Highlighter rules apply to every file you open, in Text view and Grep view. They do not apply in Table, NDJSON, or Hex view. Highlighters color only the part of a line that Text view shows, the first 2,000 bytes. With the Canvas renderer setting on, colors can be misplaced on lines that contain tabs.
Add a highlighter
Section titled “Add a highlighter”-
Press
Ctrl + Shift + H, or select More actions (…) → Highlighters. -
Select New rule.
-
Type the text to color in Pattern. Optionally give the rule a Name; without one, the rule is named after its pattern.
-
Set the options:
- Regex: read the pattern as a regular expression.
- Ignore case: on by default.
- Whole word: match only whole words.
- Scope: Match colors the matching text. Whole line colors the text of every line that matches.
-
Choose one of the 8 colors in Colour. Vaste preselects a color that no other rule uses.
-
Select Add.
Vaste saves the rule at once, and every open window shows it. If the pattern is empty or not a valid regular expression, the dialog shows Enter a pattern. or Invalid regular expression. and Add is unavailable.
Highlighter regular expressions use JavaScript syntax, which differs from the syntax of search. A pattern that works in one may not work, or may match differently, in the other.
Highlight the selected text
Section titled “Highlight the selected text”To make a highlighter from text in a line, select the text and press Alt + H, or right-click and select Highlight selection. Vaste adds a rule for the first line of the selection, as plain text that ignores case, in the next free color, and shows Highlighter added for with the text. You can select the text with the mouse, as a block, or as a line range. See Selecting and copying.
Manage highlighters
Section titled “Manage highlighters”The Highlighters dialog lists every rule with its color, name, and pattern, and tags rules that use Regex or Whole line. For each rule you can:
- Turn it on or off with its switch, without deleting it.
- Change it with Edit rule, then select Update.
- Delete it with Delete rule, after you confirm Delete highlighter.
You can have up to 200 rules. Vaste saves them in its data folder, so they are still there after you restart Vaste. See Data and cache locations.
When rules overlap
Section titled “When rules overlap”When two rules match the same text, the rule higher in the list wins. New rules are added at the end of the list, and the list cannot be reordered: to move a rule up, delete the rules above it and add them again.
A Whole line rule that matches a line colors the rest of that line’s text, and the rules after it are skipped for that line.
Search matches are drawn over highlighter colors, so the current search stays visible.
Next steps
Section titled “Next steps”- Timestamps and go to time: jump to a time and see gaps between log lines
- Investigating a log incident: use levels, highlighters, and search together