ErrorLogger
Never lose a terminal error again.
ErrorLogger is a VS Code extension that automatically captures, parses, and stores errors from the integrated terminal. When new logs push an error out of view, it is still waiting in a searchable local history.
Features
- Monitors every VS Code integrated terminal, including terminals that already exist when the extension activates
- Captures complete error blocks (message + stack) instead of one line at a time
- Parses JavaScript, TypeScript, Node.js, React/Vite/Webpack, Python, and Java output
- Groups duplicate errors and tracks occurrence count, first seen, and last seen
- Sidebar with recent errors, timeline, and terminals
- Dashboard, analytics, search, JSON/CSV export
- Click an error to open the file and jump to the reported line
- All data stays on your machine — no telemetry by default
Screenshots
Sidebar, dashboard, and error detail screenshots can be added here after the first Extension Development Host run.
Installation
- Clone this repository.
- Run
npm install.
- Run
npm run watch.
- Press
F5 to launch the Extension Development Host.
A packaged .vsix can be produced with:
npm run package
Usage
Open any integrated terminal and run your usual commands. ErrorLogger attaches automatically.
When an error appears:
- Open the ErrorLogger activity bar icon.
- Browse Recent Errors, or run ErrorLogger: Search Errors.
- Open the file at the captured location, or inspect the full stack in the detail view.
You do not need to start capture manually.
Supported Languages
| Runtime |
Examples |
| JavaScript |
TypeError, ReferenceError, UnhandledPromiseRejection |
| TypeScript |
error TS2322, TS2304, TS2339 |
| Node.js |
ECONNREFUSED, MODULE_NOT_FOUND, ENOENT |
| React / Vite / Webpack |
Failed to compile, Module not found, [vite] Internal server error |
| Python |
Traceback, KeyError, ModuleNotFoundError |
| Java |
Exception in thread, NullPointerException |
| Generic |
ERROR, FATAL, failed, file:line patterns |
Commands
| Command |
Description |
| ErrorLogger: Open Dashboard |
Stats, activity, and recent errors |
| ErrorLogger: Open Timeline |
Errors grouped by Today / Yesterday / This Week / Older |
| ErrorLogger: Open Analytics |
Files, common types, session stats |
| ErrorLogger: Search Errors |
Search message, type, file, terminal, command, stack |
| ErrorLogger: Clear Error History |
Delete all stored errors |
| ErrorLogger: Clear Today's Errors |
Delete errors from today |
| ErrorLogger: Export Errors |
Write JSON or CSV |
| ErrorLogger: Toggle Error Tracking |
Pause or resume capture |
| ErrorLogger: View Active Terminals |
Focus the terminals sidebar |
Settings
| Setting |
Default |
Description |
errorlogger.enabled |
true |
Capture terminal errors |
errorlogger.captureWarnings |
true |
Also store warnings |
errorlogger.maxStoredErrors |
10000 |
Maximum stored records |
errorlogger.maxBufferLines |
1000 |
In-memory lines per terminal |
errorlogger.autoCleanDays |
30 |
Delete records older than N days (0 disables) |
errorlogger.excludePatterns |
[] |
Ignore matching errors (regular expressions) |
errorlogger.showNotifications |
false |
Notify when a new unique error is captured |
errorlogger.debug |
false |
Write debug logs to the ErrorLogger output channel |
Privacy
All captured terminal data stays on your machine.
ErrorLogger never sends terminal output, error text, or file paths to a remote service. There is no telemetry by default. The SQLite database is stored in VS Code workspace storage (falling back to global storage when no workspace is open).
Architecture
VS Code terminals
│
▼
TerminalManager → TerminalRegistry
│
▼
Shell Integration listener
window.onDidStartTerminalShellExecution
execution.read() ← incremental stream, called immediately
│
▼
OutputBuffer (capped)
│
▼
ErrorDetector + ErrorBlockCollector
│
▼
ParserRegistry
│
▼
ErrorService (fingerprint + SQLite + UI refresh)
Terminal output capture
ErrorLogger uses the stable Terminal Shell Integration API introduced in VS Code 1.93:
vscode.window.terminals — attach to existing terminals on activation
vscode.window.onDidOpenTerminal / onDidCloseTerminal — lifecycle
vscode.window.onDidChangeTerminalShellIntegration — integration became ready
vscode.window.onDidStartTerminalShellExecution — a command started
TerminalShellExecution.read() — async iterable of output for that command
vscode.window.onDidEndTerminalShellExecution — flush a pending error block
This is the supported replacement for the old proposed onDidWriteTerminalData API, which was never stabilized for performance reasons.
read() is called synchronously inside the start event. If it is delayed, VS Code drops data that was already written.
Long-running commands such as npm run dev keep the stream open, so Vite/webpack errors that appear later are still captured.
Known limitations
Capture requires VS Code shell integration. It is enabled by default for bash, zsh, fish, and PowerShell.
- Output already sitting in the terminal before ErrorLogger activates cannot be recovered.
- Shells without integration (some
cmd.exe setups, certain remote hosts, disabled setting) cannot stream output to extensions. ErrorLogger still tracks the terminal and waits for integration.
- Streams include ANSI/OSC sequences; ErrorLogger strips them before parsing.
execution.read() can hang until process end for some multi-line injected commands. User-typed commands and long-running dev servers are the supported path.
Storage
SQLite is used for local persistence. The implementation uses sql.js (SQLite compiled to WebAssembly) instead of better-sqlite3.
better-sqlite3 is a native Node addon. VS Code extensions run on Electron's Node ABI, which does not match a normal npm install binary and cannot be packaged reliably for the Marketplace. sql.js avoids native compilation, works on every platform the extension host supports, and still speaks SQL with the schema below.
Database file: errorlogger.sqlite under context.storageUri (workspace) or context.globalStorageUri.
Development
npm install
npm run watch
Then launch Run Extension from the debug panel (F5).
| Script |
Purpose |
npm run compile |
Production-unminified esbuild bundle |
npm run watch |
Rebuild on change |
npm run lint |
ESLint |
npm run format |
Prettier |
npm test |
Vitest (parsers, detection, fingerprinting, database) |
npm run typecheck |
tsc --noEmit |
npm run package |
Minified bundle + vsce package |
Minimum VS Code engine: 1.93.0 (shell integration API).
Contributing
Issues and pull requests are welcome. Please:
- Keep terminal capture on the stable shell integration APIs.
- Add parser tests for new error formats.
- Do not introduce network calls or telemetry.
- Run
npm test and npm run lint before opening a PR.