https://github.com/designmynight/laravel-log-mailer
A package to support logging via email in Laravel
https://github.com/designmynight/laravel-log-mailer
email email-log laravel laravel-logging monolog other
Last synced: 10 days ago
JSON representation
A package to support logging via email in Laravel
- Host: GitHub
- URL: https://github.com/designmynight/laravel-log-mailer
- Owner: designmynight
- License: mit
- Created: 2018-09-04T21:49:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T15:38:04.000Z (over 1 year ago)
- Last Synced: 2024-08-08T18:05:11.726Z (10 months ago)
- Topics: email, email-log, laravel, laravel-logging, monolog, other
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 15
- Watchers: 3
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Mail Logger
===============[](https://packagist.org/packages/designmynight/laravel-log-mailer) [](https://packagist.org/packages/designmynight/laravel-log-mailer)
[](https://github.styleci.io/repos/147424037)
[](https://opensource.org/licenses/MIT)A service provider to add support for logging via email using Laravels built-in mail provider

Table of contents
-----------------
* [Installation](#installation)
* [Configuration](#configuration)Installation
------------Installation using composer:
```sh
composer require designmynight/laravel-log-mailer
```### Laravel version Compatibility
Laravel | Package |
:---------|:--------|
5.6.x | 1.0.x |And add the service provider in `config/app.php`:
```php
DesignMyNight\Laravel\Logging\MailableLogServiceProvider::class,
```For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`.
```php
$app->register(DesignMyNight\Laravel\Logging\MailableLogServiceProvider::class);
```Configuration
------------Most configuration options can be automatically populated by environment variables or in config/mailablelog.php, to generate it run php artisan vendor:publish.
To ensure all unhandled exceptions are mailed, set up a mail logging channel and add it to your logging stack in config/logging.php:
```php
'channels' => [
'stack' => [
'driver' => 'stack',
// Add mail to the stack:
'channels' => ['single', 'mail'],
],// ...
// Create a mail logging channel:
'mail' => [
'driver' => 'mail',
// Specify who to mail the log to
'to' => [
[
'address' => '[email protected]',
'name' => 'Error'
]
],
// Optionally specify who the log mail was sent by
// This is overidable in config/mailablelog.php and
// falls back to your global from in config/mail.php
'from' => [
'address' => '[email protected]',
'name' => 'Errors'
],
// Optionally overwrite the mailable template
// 'mailable' => NewLogMailable::class
],
],
```You can specify multiple channels and change the recipients and customise the email template per channel.