alpinedigital / log-dashboard-craft
In-project log viewer for local development — reads the host project's own storage/logs from the Craft control panel, no SSH.
Package info
github.com/alpine-digital/log-dashboard-craft
Type:craft-plugin
pkg:composer/alpinedigital/log-dashboard-craft
Requires
- php: ^8.2
- craftcms/cms: ^4.0.0 || ^5.0.0
README
In-project log viewer for local development, built as a Craft CMS plugin.
Install it into a Craft project and open its control panel section to browse
that project's own storage/logs — no SSH, no separate app. It runs inside
the host project and reads the log files straight off the local disk.
Requirements
- PHP 8.2+
- Craft CMS 5
- A logged-in control panel user with the "Access the log dashboard" permission
- Admin changes allowed in the environment (see Security)
- The project runs in DDEV (the examples use
ddev; plain Composer works too)
Install (private GitLab repo)
This is a private repo, so Composer needs access to GitLab — and because the app runs in DDEV, the container needs that access, not just your host.
1. Add the repository as a git repository:
ddev composer config repositories.log-dashboard-craft git git@gitlab.com:alpinedigital/log-dashboard-craft.git
Note the type is
git, notvcs. Withvcson agitlab.comURL Composer uses its GitLab driver, which calls the GitLab API (api/v4/...) first and returns404on a private repo — even though your SSH key works.type: gituses the plain git driver: it clones over SSH, no API and no token involved. (no-api: truedoes not help here — that option only applies to GitHub.)
Or add it by hand in composer.json
Same result, next to the other top-level keys:
"repositories": [ { "type": "git", "url": "git@gitlab.com:alpinedigital/log-dashboard-craft.git" } ]
Use this if you prefer editing the file — but the command above is easier and
avoids the JSON-quoting issues ddev composer config --json … hits on
Windows/PowerShell.
2. Give the container your SSH key, install, and enable the plugin:
ddev auth ssh ddev composer require --dev alpinedigital/log-dashboard-craft:@dev ddev craft plugin/install log-dashboard
ddev auth ssh forwards your host SSH agent into the container (once per ddev
session). You need an SSH key registered on your GitLab account — verify with
ssh -T git@gitlab.com on the host. Update later with
ddev composer update alpinedigital/log-dashboard-craft.
Alternative: HTTPS + deploy token (no SSH)
-
In GitLab: Settings → Repository → Deploy tokens, create one with
read_repositoryscope. -
Hand the token to Composer inside the container, then install:
ddev composer config --global gitlab-token.gitlab.com <token-username> <token> ddev composer config repositories.log-dashboard-craft vcs https://gitlab.com/alpinedigital/log-dashboard-craft.git ddev composer require --dev alpinedigital/log-dashboard-craft:@dev ddev craft plugin/install log-dashboard
3. Grant the permission. In the control panel, go to a user's or user group's permissions and check "Access the log dashboard" under the Log Dashboard heading (admins have it implicitly).
Usage
With the project served locally and logged into the control panel, open:
https://<project>.ddev.site/admin/log-dashboard
(Replace admin with your project's cpTrigger if you've customized it.) You
land on the log-file list; click a file to view its entries (level filter,
search, live refresh). Or open it anytime with:
ddev launch admin/log-dashboard
Auto-open on ddev start (optional)
Copy the bundled stub into your project's .ddev/ to open the dashboard in a
browser tab automatically after every ddev start:
cp vendor/alpinedigital/log-dashboard-craft/stubs/config.logdashboard.yaml .ddev/ ddev restart
DDEV merges every .ddev/config.*.yaml, so this only adds a post-start hook.
Configuration
Copy vendor/alpinedigital/log-dashboard-craft/config/log-dashboard.php to your
project's config/log-dashboard.php to override defaults:
| Key | Default | Env |
|---|---|---|
enabled |
follows Craft's devMode general config setting |
LOG_DASHBOARD_ENABLED |
path |
Craft's own storage/logs directory |
LOG_DASHBOARD_PATH |
Point path elsewhere via LOG_DASHBOARD_PATH.
Security
The dashboard exposes log contents through the control panel, so:
- Install it as
--devonly. - Access requires being logged in and holding the plugin's "Access the log dashboard" permission — grant it only to trusted developers.
- The plugin's control panel section and routes mount only when
enabled(which followsdevModeby default), and the plugin hard-blocks wheneverallowAdminChangesis disabled — the standard Craft signal that an environment is locked down — regardless of theenabledsetting.
Never enable this on a shared production environment.
Notes
- The compiled dashboard UI ships pre-built under
resources/dist. Its Angular source lives in the main Log-dashboard project; this repo carries the built assets so consumers never run a frontend build. - The log parser auto-detects both Laravel's bracketed log format and Craft's
own Monolog line format (
%datetime% [%channel%.%level%] [%category%] %message%), so it reads Craft'sstorage/logs/*.logfiles out of the box.