PHPackages                             forestry/logcabin-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. forestry/logcabin-laravel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

forestry/logcabin-laravel
=========================

Ships logs and health heartbeats from a Laravel application to a central Log Cabin panel.

v1.0.1(1mo ago)057↓66.7%[1 PRs](https://github.com/forestrylabs/logcabin-laravel/pulls)AGPL-3.0-or-laterPHPPHP ^8.2CI passing

Since Jul 17Pushed 1mo agoCompare

[ Source](https://github.com/forestrylabs/logcabin-laravel)[ Packagist](https://packagist.org/packages/forestry/logcabin-laravel)[ Docs](https://github.com/forestrylabs/logcabin-laravel)[ RSS](/packages/forestry-logcabin-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (10)Versions (4)Used By (0)

Log Cabin for Laravel
=====================

[](#log-cabin-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f049142d34626082641b9d5d9a7bbb97113b0bf9bf9fa14112a33530879c5304/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666f7265737472792f6c6f67636162696e2d6c61726176656c2e737667)](https://packagist.org/packages/forestry/logcabin-laravel)[![Tests](https://github.com/forestrylabs/logcabin-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/forestrylabs/logcabin-laravel/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/a0bdd25669caeada24a3e56509716da38eb68e79935993a0b2861fb042e50018/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666f7265737472792f6c6f67636162696e2d6c61726176656c2e737667)](https://packagist.org/packages/forestry/logcabin-laravel)[![License](https://camo.githubusercontent.com/0502971c2da3ed9e69e94d960a363025657c344eac2db6926d1eb16fbddba580/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666f7265737472792f6c6f67636162696e2d6c61726176656c2e737667)](LICENSE)

Ships logs and health heartbeats from a Laravel application to a central [Log Cabin](https://github.com/forestrylabs/logcabin) panel.

Once installed, existing `Log::error()` calls and unhandled exceptions are delivered to your panel with no code changes, delivery is queued so a panel outage never blocks your app, and a self-scheduled heartbeat reports the site's health every few minutes.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11, 12 or 13

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require forestry/logcabin-laravel
```

Publish the configuration file:

```
php artisan vendor:publish --tag=logcabin-config
```

Then set the following in your `.env`:

```
LOGCABIN_ENDPOINT=https://logcabin.example.com
LOGCABIN_TOKEN=the-token-issued-from-the-Log-Cabin-panel
QUEUE_CONNECTION=database
```

The token comes from the Log Cabin panel: open the site under **Sites**, then use the **Generate API Token** action on the site's edit page. The plaintext token is only shown once, so copy it straight into `.env`. The token alone identifies the site.

> **Note:** No Laravel Sanctum install is needed on your app. This package is a plain HTTP client that sends an `Authorization: Bearer ` header; Sanctum only lives on the Log Cabin panel to verify that token.

`QUEUE_CONNECTION` matters: log and heartbeat delivery is queued so a Log Cabin outage never blocks the client app's own requests. If the app already uses a non-sync queue driver (redis, database, etc.) nothing further is needed. If it's on `sync`, switch it to `database` (run `php artisan queue:table && php artisan migrate` if that table doesn't exist yet) and make sure a queue worker is running (see [Production setup](#production-setup) below).

Configuration
-------------

[](#configuration)

All settings are driven by environment variables, so you rarely need to edit the published config file directly.

VariableDefaultDescription`LOGCABIN_ENDPOINT``https://logcabin.example.com`Base URL of the Log Cabin panel.`LOGCABIN_TOKEN``null`API token identifying the site.`LOGCABIN_ENABLED``true`Master switch; when `false`, nothing is delivered.`LOGCABIN_QUEUE``default`Queue name the delivery jobs run on.`LOGCABIN_LOG_LEVEL``error`Minimum log level captured by the `logcabin` channel.`LOGCABIN_AUTO_ATTACH``true`Append the `logcabin` channel to the `stack` channel automatically.`LOGCABIN_HEARTBEAT_INTERVAL``5`Minutes between automatic heartbeats.Usage
-----

[](#usage)

### Automatic error capture

[](#automatic-error-capture)

By default, the package appends a `logcabin` log channel to your app's `stack` channel, so existing `Log::error()` calls and unhandled exceptions ship automatically with no code changes required. Set `LOGCABIN_AUTO_ATTACH=false` to disable this if your app doesn't log through `stack`.

### Manual reporting

[](#manual-reporting)

Report events or exceptions explicitly through the `LogCabin` facade:

```
use Forestry\LogCabin\Laravel\Facades\LogCabin;

LogCabin::report('payment.failed', 'Charge declined', ['order_id' => $order->id]);
LogCabin::reportException($exception);
```

### Heartbeats

[](#heartbeats)

A `logcabin:heartbeat` command is registered and self-scheduled (every `LOGCABIN_HEARTBEAT_INTERVAL` minutes, default 5). No changes to your app's scheduler are required, as long as `php artisan schedule:run` is already running via cron.

Production setup
----------------

[](#production-setup)

Three background processes need to be running on the server for this package to actually deliver anything. It fails silently if they aren't, by design, so that it never takes the app down.

1. **Cron entry for the scheduler** (drives both the heartbeat and the scheduler-liveness signal): ```
    * * * * * cd /path/to/your/app && php artisan schedule:run >> /dev/null 2>&1
    ```
2. **A queue worker** processing the queue named in `LOGCABIN_QUEUE` (default `default`). This is what actually sends the HTTP requests for logs and heartbeats. Under Supervisor: ```
    [program:app-queue-worker]
    command=php /path/to/your/app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
    directory=/path/to/your/app
    autostart=true
    autorestart=true
    numprocs=1
    user=www-data
    redirect_stderr=true
    stdout_logfile=/path/to/your/app/storage/logs/queue-worker.log
    ```

    Reload with `supervisorctl reread && supervisorctl update && supervisorctl restart app-queue-worker`. If the app already runs a queue worker for its own jobs, this package's jobs ride along on the same worker. No separate process is needed unless you want the `LOGCABIN_QUEUE` isolated.
3. **Outbound HTTPS access** from the server to `LOGCABIN_ENDPOINT`. Check firewall and egress rules if tokens validate locally (`php artisan tinker` then `Http::withToken(...)->post(...)`) but nothing shows up in the panel.

Quick end-to-end check after deploying:

```
php artisan logcabin:heartbeat   # run once manually; should queue a heartbeat job
php artisan queue:work --once    # process it
```

Then confirm the site shows a recent `last_seen_at` in the Log Cabin panel. If it doesn't move, check `storage/logs/laravel.log` on the client site. The package's jobs log delivery failures there after retries are exhausted, via the `single` channel rather than through `logcabin`itself, to avoid a retry loop when the app's default log channel includes `logcabin`.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for a list of changes.

License
-------

[](#license)

The GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). See [LICENSE](LICENSE)for details.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/306137040?v=4)[forestrylabs](/maintainers/forestrylabs)[@forestrylabs](https://github.com/forestrylabs)

---

Top Contributors

[![foe-fyi](https://avatars.githubusercontent.com/u/89912000?v=4)](https://github.com/foe-fyi "foe-fyi (1 commits)")

---

Tags

laravelloggingmonitoringheartbeatuptimelogcabin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/forestry-logcabin-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/forestry-logcabin-laravel/health.svg)](https://phpackages.com/packages/forestry-logcabin-laravel)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M358](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k31.8M168](/packages/laravel-cashier)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

80732.6M276](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58190.1k22](/packages/api-platform-laravel)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

13102.4k](/packages/shaffe-laravel-mail-log-channel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.5k](/packages/forjedio-inertia-table)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
