PHPackages                             portavice/laravel-log-errors-to-mail - 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. portavice/laravel-log-errors-to-mail

Abandoned → [sytxlabs/laravel-error-logger](/?search=sytxlabs%2Flaravel-error-logger)ArchivedLibrary[Logging &amp; Monitoring](/categories/logging)

portavice/laravel-log-errors-to-mail
====================================

Adds a logging channel that sends log messages via email to a configured email address

v1.2.0(1y ago)32.3k↓73.3%1MITPHPPHP ^8.1CI passing

Since May 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/portavice/laravel-log-errors-to-mail)[ Packagist](https://packagist.org/packages/portavice/laravel-log-errors-to-mail)[ Docs](https://portavice.de)[ RSS](/packages/portavice-laravel-log-errors-to-mail/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

Log Errors to E-Mail for Laravel
================================

[](#log-errors-to-e-mail-for-laravel)

[![MIT Licensed](https://camo.githubusercontent.com/c2bffd81d308ced1cc3b0d66fb0ed453ab478a5e17c988b780f9de986a390ee2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package adds a basic logging channel that sends E-Mails for messages from a specific error level upwards to preconfigured recipients using a Laravel mail transport.

Prerequisites
-------------

[](#prerequisites)

- A configured default Laravel mail driver

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

[](#installation)

```
composer require portavice/laravel-log-errors-to-mail
```

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

[](#configuration)

To configure your Laravel application to use the logger, you should create a logging channel in your `logging.php`configuration file.

For example a stack channel that logs to the default stack and sends email notifications:

```
return [
    // ...
    'channels' => [
        // ...

        'stack_with_email' => [
            'driver' => 'stack',
            'channels' => ['stack', 'log_errors_to_mail'],
            'ignore_exceptions' => false,
        ],
    ],
    // ...
];
```

You may then set the logging channel in your `.env` file or as the default logging channel in your `logging.php`.

```
LOG_CHANNEL=stack_with_email
```

### Customization

[](#customization)

The library offers some customization for the default `laravel_mail_logger` channel via environment variables.

```
# defaults
# the name of the laravel mailer to use when sending email. (blank by default)
 # if omitted, uses the global default mailer configured for your laravel application
LOG_ERROR_TO_MAIL_MAILER=
# recipient of the error emails (blank by default)
LOG_ERROR_TO_MAIL_TO=
# deduplicate error emails (on by default)
LOG_ERROR_TO_MAIL_DEDUPLICATE=true
# minimum PSR log level to send emails for (error by default)
LOG_ERROR_TO_MAIL_LEVEL=error
```

It's also possible to publish the configuration for this package with the `artisan vendor:publish` command.

```
$ php artisan vendor:publish --tag=laravel-log-errors-to-mail
```

### Choosing the Mail Transport

[](#choosing-the-mail-transport)

By default, the application uses the default mail driver of your Laravel application.

To change the driver used, you may publish the logger configuration and change the "laravel\_log\_errors\_to\_mail.email\_driver" option to the mail driver name you desire.

The mail driver should extend the `\Illuminate\Mail\Mailer` class and return a valid `\Symfony\Component\Mailer\Transport\TransportInterface` instance from the `Mailer::getSymfonyTransport()`Method.

Known issues
------------

[](#known-issues)

### Mail drivers using a 'log' transport

[](#mail-drivers-using-a-log-transport)

Mail drivers using a `\Illuminate\Mail\Transport\LogTransport` transport are not supported and the EmailHandler will fall back to a `NoopHandler`.

**However**, this automatic fallback currently only works if the selected driver directly uses a `LogTransport`. If you for example set a `RoundRobinTransport` with a `LogTransport` mail driver, it will end up in an infinite recursion loop.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance49

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~194 days

Total

3

Last Release

376d ago

### Community

Maintainers

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

---

Top Contributors

[![frugan-dev](https://avatars.githubusercontent.com/u/7957714?v=4)](https://github.com/frugan-dev "frugan-dev (2 commits)")[![shaunluedeke](https://avatars.githubusercontent.com/u/77498048?v=4)](https://github.com/shaunluedeke "shaunluedeke (2 commits)")

---

Tags

loglaravelloggingmaile-mail

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/portavice-laravel-log-errors-to-mail/health.svg)

```
[![Health](https://phpackages.com/badges/portavice-laravel-log-errors-to-mail/health.svg)](https://phpackages.com/packages/portavice-laravel-log-errors-to-mail)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[illuminate/log

The Illuminate Log package.

6225.3M623](/packages/illuminate-log)[illuminate/mail

The Illuminate Mail package.

5910.6M501](/packages/illuminate-mail)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M572](/packages/shopware-core)

PHPackages © 2026

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