Installation
Lumberjack for Laravel needs PHP 8.3 or newer and Laravel 12 or 13.
The package
composer require exeque/laravel-lumberjackThe service provider and the Lumberjack facade register themselves.
Set it up
Create a project in Lumberjack; its settings page shows the URL, the server token and the public key under Installation. Then:
php artisan lumberjack:installIt asks for the three values and walks through the rest:
- Connection. It sends a heartbeat with the token to check the URL and token, and says why when that fails (Lumberjack cannot be reached, the token is refused, another answer), so you can enter them again or carry on. The project's agents in Lumberjack list that heartbeat as an agent named
lumberjack:install. .env. It writesLUMBERJACK_URL,LUMBERJACK_TOKENandLUMBERJACK_PUBLIC_KEY, and asks before replacing a value that is already there. The rest of the file stays as it was. It offers to add the keys to.env.examplewith empty values.- Queues. It suggests
LUMBERJACK_QUEUESfromconfig/queue.phpand Horizon's supervisors, for the queue sizes the agent reports. - Browser errors. It lists the Blade views with a
</head>(your layouts, orapp.blade.phpwith Inertia) and puts@lumberjackbefore</head>in the ones you pick. - Health checks. It suggests checks from your config (the database, the cache store, Redis when the cache or queue uses it, remote disks, the queue, Horizon when installed, failed jobs, debug mode, migrations, mail over SMTP; every disk but
publiccan be picked) and writes the ones you pick toapp/Providers/LumberjackServiceProvider.php, registered inbootstrap/providers.php. YourAppServiceProvideris left alone. When the provider exists, it asks before writing it again. - The agent. It asks how the app runs (Forge or Supervisor, systemd, Docker, Kubernetes) and prints the config to run the agent with.
- Check. When
.envchanged, it tells you to restart the agent and runlumberjack:test. When nothing changed and the agent answers, it offers to send the test exception itself.
Running it again changes nothing that is already set up, so it is safe to run to add what is missing.
Without questions
For a script or CI, pass the values as options:
php artisan lumberjack:install --no-interaction \
--url=https://lumberjack.example.com --token=lj_srv_... --key=pk_... \
--checks=database,cache,disk:s3,queue:redis:emails,failed-jobs \
--layout=resources/views/layouts/app.blade.php \
--queues=default,redis:emailsWithout --checks it uses the suggested checks, without --layout it leaves the views alone (--layout=auto picks the only layout there is), and without --queues it writes LUMBERJACK_QUEUES only when it found more than the default queue. A failed connection check stops it before anything is written; --no-verify skips the check. An existing value or provider is kept unless you pass --force. See lumberjack:install for every option.
By hand
Instead of the command, set the keys from the project's settings in .env:
LUMBERJACK_URL=https://lumberjack.example.com
LUMBERJACK_TOKEN=lj_srv_...
LUMBERJACK_PUBLIC_KEY=pk_...LUMBERJACK_TOKENis the server token. Only the agent uses it, to send to Lumberjack.LUMBERJACK_PUBLIC_KEYis for browser errors. Leave it out to send none.
Put @lumberjack in the <head> of your layout for browser errors, and register health checks in a service provider.
Environment and release
Set the environment and release too, so Lumberjack can tell them apart:
LUMBERJACK_ENVIRONMENT=production # defaults to APP_ENV
LUMBERJACK_RELEASE=2026.11.1 # optional: found in .git or vendor when emptyWithout LUMBERJACK_RELEASE the release is the commit in the app's .git directory, or else the commit Composer installed vendor from. See Release for other deploys.
The agent
The app never talks to Lumberjack itself. It hands everything to a local agent, which sends it on, so a slow or unreachable Lumberjack cannot slow the app down. Run one per app per server, under Supervisor or systemd; see The agent.
php artisan lumberjack:agentCheck it works
With the agent running:
php artisan lumberjack:testA test exception shows up in Lumberjack within a few seconds. If the command says there is no agent, the agent is not running, or it listens on another port than the app sends to.
Next
- What is recorded, and how to leave things out
- Logs, to send log lines to Lumberjack's log channels
- Browser errors, with one Blade directive
- Reacting to alerts, to turn on a status banner when something escalates