Slog ViewerBeautiful structured log viewer for debugging. Automatically transforms JSON/logfmt logs into readable, interactive output with syntax highlighting, filtering, and search.
Features
Quick Start
Task SupportVS Code Tasks let you run commands directly from VS Code. By using Before (standard shell task — logs only in terminal):
After (slogViewer task — logs in Slog Viewer panel + terminal):
Complete
|
| Property | Required | Description |
|---|---|---|
command |
Yes | The command to execute |
args |
No | Array of command arguments |
cwd |
No | Working directory (defaults to workspace folder) |
env |
No | Additional environment variables |
Variable substitution is supported: ${workspaceFolder}, ${file}, ${env:VAR_NAME}.
Log File Support
Open any log file containing structured JSON or logfmt entries directly in the Slog Viewer panel.
Opening a Log File
- Command Palette: Run
Slog Viewer: Open in Slog Viewerand select a file - Explorer Context Menu: Right-click a log file and select Open in Slog Viewer or Watch in Slog Viewer (Live Tail)
Live Tail (Watch Mode)
Use "Slog Viewer: Watch in Slog Viewer (Live Tail)" to monitor a file for new log entries in real time. New lines appended to the file automatically appear in the panel. Log rotation (file truncation) is handled automatically.
Notes
- Each file appears as a separate session in the session dropdown
- Non-structured lines (plain text, stack traces) are silently skipped
- Any text file with JSON or logfmt log lines is supported (
.log,.json,.jsonl,.txt, etc.)
Supported Formats
JSON
{"time":"2025-01-01T00:00:00Z","level":"info","message":"Server started","port":8080}
Logfmt
time=2025-01-01T00:00:00Z level=info msg="Server started" port=8080
Advanced Filtering
- Right-click any value - Right-click on a log message or any JSON field value to open the filter menu
- Include/Exclude - Choose to show only logs with that value, or hide logs with that value
- Filter chips - Active filters appear as chips below the toolbar
- Green chips = include filters
- Red chips = exclude filters
- Click a chip to toggle it on/off
- Click × to remove a filter
- Add Filter button - Manually create filters for any field
Example: To hide all "http request" logs, right-click on a message containing "http request" and select "Exclude".
Tip: File path values support both left-click (opens the file) and right-click (filter menu with an additional "Open file" option).
Configuration
Access via VSCode Settings → "Slog Viewer":
| Setting | Default | Description |
|---|---|---|
slogViewer.autoReveal |
true |
Automatically reveal the panel when the first structured log is detected. Set to false to open the panel manually. |
slogViewer.collapseJSON |
true |
Show log details collapsed by default (click to expand) |
slogViewer.showRawJSON |
false |
Show the raw JSON log below each formatted entry |
slogViewer.autoScroll |
true |
Automatically scroll to the latest log entry |
slogViewer.theme |
auto |
Theme for the log viewer (light, dark, or auto) |
License
MIT
