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.5.0(1y ago)344.1k↑43.8%12PHPPHP ^8.3

Since Oct 14Pushed 1y 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 1mo ago

READMEChangelog (10)Dependencies (1)Versions (23)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

45

—

FairBetter than 93% of packages

Maintenance42

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 55.9% 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 ~64 days

Recently: every ~176 days

Total

20

Last Release

459d 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 (19 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

[overtrue/laravel-query-logger

A dev tool to log all queries for laravel application.

413307.5k6](/packages/overtrue-laravel-query-logger)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14642.7k1](/packages/guanguans-laravel-exception-notify)[regulus/activity-log

A clean and simple Laravel 5 activity logger for monitoring user activity on a website or web application.

164220.1k2](/packages/regulus-activity-log)

PHPackages © 2026

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