Log Filter
A VS Code extension for visually filtering large .log files by free-text/regex, log level, and source (module/function).
Features
- Handles large files. Loads up to
logFiltering.maxLines lines (default 10,000); if a file is larger, it shows the most recent lines by default and tells you how many were left out. The list view is virtualized so it stays smooth even at the full 10k+ line count.
.log file support. Adds a filter (⧩) button to the editor title bar for any open .log file, plus a right-click entry in the Explorer.
- Visual filtering UI. A dedicated webview panel with a search box, level chips, and source chips — no editing the file, no external tools.
- Filter by source (module/function). Each line is parsed to pull out its logger/module/function name (e.g.
[com.example.OrderProcessor]), and you can toggle one or more sources on/off as clickable chips with live counts.
- Regex filtering. The search box treats input as a regular expression by default (toggle off for plain text), with match highlighting and a case-sensitivity toggle.
- Click-to-reveal. Click any filtered line to jump straight to it in the original file.
- Follow mode. Automatically reloads the view when the underlying log file changes on disk (toggle via
logFiltering.follow).
Usage
- Open a
.log file.
- Click the filter icon in the editor title bar (or right-click the file in the Explorer → "Log Filter: Open Filtered View").
- Type in the search box (regex by default), and click level/source chips to narrow things down.
Settings
| Setting |
Default |
Description |
logFiltering.maxLines |
10000 |
Max lines loaded into the view. |
logFiltering.readFrom |
end |
Which end of an oversized file to load from (end = most recent, start). |
logFiltering.parsePattern |
see below |
JS regex (named groups timestamp, level, source, message) used to parse each line. |
logFiltering.caseSensitive |
false |
Default case-sensitivity for search. |
logFiltering.follow |
true |
Reload automatically when the file changes on disk. |
The default parse pattern recognizes common formats like:
2026-08-21T10:15:23.123Z INFO [com.example.OrderProcessor] Order created (id=42)
2026-08-21 10:15:23,123 ERROR [workers.EmailWorker] Failed to send email
Lines that don't match the pattern (e.g. stack trace continuation lines) are folded into the preceding log entry rather than shown as separate unparsed rows. Adjust logFiltering.parsePattern if your log format differs — it just needs level and/or timestamp, source, and message named capture groups.
Development
npm install
npm run compile # or: npm run watch
Then press F5 in VS Code to launch an Extension Development Host, open sample/app.log (generate it first with node sample/generate-sample.js — it writes 12,000 lines so truncation and virtualization are both exercised) and try the filter view.