PHPackages                             justbetter/laravel-error-logger - 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. justbetter/laravel-error-logger

ActiveLaravel-package[Logging &amp; Monitoring](/categories/logging)

justbetter/laravel-error-logger
===============================

Simple way to log errors with Laravel Nova support.

2.6.0(2mo ago)346.5k↑14.6%12PHPPHP ^8.3

Since Oct 14Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/justbetter/laravel-error-logger)[ Packagist](https://packagist.org/packages/justbetter/laravel-error-logger)[ RSS](/packages/justbetter-laravel-error-logger/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (2)Versions (24)Used By (2)

Laravel Error Logger
====================

[](#laravel-error-logger)

This packages contains a nice and easy way to log errors that happen in your application. A job can be added to your scheduler in order to receive daily notifications about reported errors via e.g. Slack.

Support for Laravel Nova is also available to view a list of reported errors with the `justbetter/nova-error-logger`package.

Please note that this package won't automatically save exceptions thrown by Laravel or PHP - you have to manually save them like the example shown later in this documentation.

Setup
-----

[](#setup)

In order to make use of the package the following actions are required.

### Publishing

[](#publishing)

Publish the configuration of the package.

```
php artisan vendor:publish --provider="JustBetter\ErrorLogger\ServiceProvider"
```

### Migrations

[](#migrations)

Run your migrations.

```
php artisan migrate
```

Scheduler
---------

[](#scheduler)

> **NOTE!** This is optional and not required in order to use the package.

In your `App\Console\Kernel.php` you can add the daily error notification job like so:

```
use JustBetter\ErrorLogger\Jobs\ErrorNotificationJob;

$schedule->job(ErrorNotificationJob::class)->dailyAt('09:00');
```

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

[](#configuration)

Add the following variable to your `.env` to define the logging channel for daily notifications if the job is enabled.

```
LARAVEL_ERROR_NOTIFICATION_CHANNEL=slack

```

Commands
--------

[](#commands)

The logging table can build up pretty fast. In order to prune older records, you can use the following command:

```
php artisan laravel-error-logger:prune --all
php artisan laravel-error-logger:prune --hours=720
```

To automatically prune the logs, you may want to add the command to your scheduler.

Example usage
-------------

[](#example-usage)

> **IMPORTANT!** When using the method `withChannel` it will directly send a notification when saved.

The error class can be easily used. No value is required to be set in order to save the log.

```
use JustBetter\ErrorLogger\Models\Error;

Error::log()
    ->withGroup('Magento')
    ->withMessage('Something went wrong!')
    ->withDetails('Extra information of this log!')
    ->withThrowable($exception)
    ->withChannel('slack')
    ->withModel($model)
    ->save();
```

### Method FromThrowable

[](#method-fromthrowable)

You may also use the method `fromThrowable`. This function accepts a `Throwable` which automatically sets the following extra attributes compared to `withThrowable`:

- withDetails
- withCode

It is still possible to override these values when chaining them after the throwable.

### Grouping

[](#grouping)

Errors will be automatically grouped. In the config you can set an interval for this. If you don't want to group you can call `dontGroup()`.

### Hiding from index

[](#hiding-from-index)

You can hide errors from the index by calling `hideFromIndex()`.

Model relation
--------------

[](#model-relation)

When using the `withModel` method you can retrieve errors for a specific model. The `\JustBetter\ErrorLogger\Traits\HasErrors` trait contains this relation with the name `errors()`

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance84

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% 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 ~82 days

Recently: every ~186 days

Total

21

Last Release

83d ago

Major Versions

1.0.8 → 2.0.02021-12-21

PHP version history (4 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

2.3.0PHP ^8.1

2.5.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d00b3f55cd4ae8b8cfb001a644ed6c7a1127a956c24375bcfe16ce12bd89bed?d=identicon)[justbetter](/maintainers/justbetter)

---

Top Contributors

[![VincentBean](https://avatars.githubusercontent.com/u/3906942?v=4)](https://github.com/VincentBean "VincentBean (21 commits)")[![ramonrietdijk](https://avatars.githubusercontent.com/u/85165272?v=4)](https://github.com/ramonrietdijk "ramonrietdijk (15 commits)")

### Embed Badge

![Health badge](/badges/justbetter-laravel-error-logger/health.svg)

```
[![Health](https://phpackages.com/badges/justbetter-laravel-error-logger/health.svg)](https://phpackages.com/packages/justbetter-laravel-error-logger)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

592.7M9](/packages/open-telemetry-opentelemetry-auto-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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