Formats php_errors.log entries into a readable, color-coded panel directly inside VS Code.
Note: This extension is primarily used as an internal tool. It is published to the VS Code Marketplace for ease of distribution and updates within the team.
Features
- Automatic detection — when a matching log file is opened, a formatted webview opens alongside it.
- Sidebar tree view — errors grouped by severity (Critical, Error, Warning, Notice, Info, Debug) or by date, with a badge showing the critical/error count.
- Webview panel — each entry displays:
- Datetime, severity level, channel
- Message and exception details (class, message, code)
- Clickable
file:linelinks that jump directly to the source location - Full stack trace with clickable links
- GET parameters
- Both log formats supported:
- JSON (Monolog-style): one JSON object per line
- Native PHP:
[date] PHP Warning: ... in file on line N, including multi-line and\n-escaped stack traces
- Live refresh — the panel and tree update automatically as the file changes on disk.
- Search and filter — filter by free text or severity level pill; group identical errors with a count badge; group by date.
- Delete entries — remove individual errors (✕ button) or clear the entire log file from both the sidebar and webview.
- Status bar — shows parsed/invalid counts while a log file is active.
Usage
The extension activates automatically when a matching log file is found in the workspace root. You can also trigger it manually:
- Click the Open Formatted View button in the editor title bar (top-right, visible when a log file is open)
- Right-click the file in the Explorer and choose PHP Error Log Viewer: Open Formatted View
- Command Palette (
Ctrl+Shift+P) → PHP Error Log Viewer: Open Formatted View
Sidebar toolbar
The sidebar panel header contains the following actions:
| Icon | Action |
|---|---|
| 📅 / 🌳 | Toggle between group-by-date and group-by-severity |
| 🗑️ | Clear all entries from the log file |
| 🔄 | Refresh the tree view |
| 👁️ | Open the formatted webview |
| 📄 | Open the raw log file in the editor |
Hovering over an individual error entry reveals an ✕ button to remove that single entry from the log file.
Webview toolbar
| Control | Description |
|---|---|
| Search box | Free-text filter across message, exception class, level, channel, and file path |
| Level pills | Click one or more severity badges to show only those levels |
| Group similar | Merge identical errors into one card with a ×N count |
| By date | Group entries into Today / This week / Last week / Older |
| Expand All / Collapse All | Toggle all cards open or closed |
| Clear all | Delete every entry from the log file (confirmation required) |
Settings
| Setting | Default | Description |
|---|---|---|
phpErrorLogViewer.autoOpen |
true |
Automatically open the formatted view when a log file is opened. |
phpErrorLogViewer.logFilePath |
"" |
Path to the PHP error log file. Accepts an absolute path (e.g. /var/log/php/errors.log) or a path relative to the workspace root (e.g. logs/php_errors.log). Leave empty to use php_errors.log in the workspace root. |
phpErrorLogViewer.defaultExpandedView |
false |
Whether error entries in the webview start expanded. Set to true to show full details by default. |
Commands
| Command | Description |
|---|---|
PHP Error Log Viewer: Open Formatted View |
Open the webview panel for the current log file |
PHP Error Log Viewer: Open Log File |
Open the raw log file in the editor |
PHP Error Log Viewer: Refresh |
Reload the log file and update the sidebar |
PHP Error Log Viewer: Group by Date |
Switch sidebar to date-based grouping |
PHP Error Log Viewer: Group by Severity |
Switch sidebar to severity-based grouping |
PHP Error Log Viewer: Remove Entry |
Delete a single error entry from the log |
PHP Error Log Viewer: Clear All Entries |
Delete all entries from the log file |
Development
Run locally
- Open this folder in VS Code.
- Press
F5to launch the Extension Development Host. - Open a
php_errors.logfile in the development host window.
Tests
npm install
npm test
Package as VSIX
npm install -g @vscode/vsce
vsce package
Then in VS Code: Extensions → ... → Install from VSIX... and select the generated .vsix file.