-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rework of the package & Laravel 6 / 7 support
Thanks to @jbeales designmynight/laravel-log-mailer#7
- Loading branch information
Showing
12 changed files
with
241 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
# Changelog | ||
|
||
All notable changes to `laravel-log-mailer` will be documented in this file | ||
All notable changes to `laravel-mail-log-channel` will be documented in this file | ||
|
||
## 1.1.0 - 2020-01-29 | ||
|
||
- add support for Laravel 6 and 7 (thanks to @jbeales https://github.com/designmynight/laravel-log-mailer/pull/7) | ||
- remove extra configuration and view files | ||
- improve exception layout in mails | ||
|
||
## 1.0.2 - 2018-09-09 | ||
|
||
- fix logging levels | ||
|
||
## 1.0.1 - 2018-09-05 | ||
|
||
- fix dependancy | ||
|
||
## 1.0.0 - 2018-09-04 | ||
- initial release | ||
|
||
- initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
Laravel Mail Logger | ||
=============== | ||
|
||
[![Latest Stable Version](http://img.shields.io/github/release/designmynight/laravel-log-mailer.svg)](https://packagist.org/packages/designmynight/laravel-log-mailer) [![Total Downloads](http://img.shields.io/packagist/dm/designmynight/laravel-log-mailer.svg)](https://packagist.org/packages/designmynight/laravel-log-mailer) | ||
[![Latest Stable Version](http://img.shields.io/github/release/shaffe/laravel-mail-log-channel.svg)](https://packagist.org/packages/shaffe/laravel-mail-log-channel) [![Total Downloads](http://img.shields.io/packagist/dm/shaffe/laravel-mail-log-channel.svg)](https://packagist.org/packages/shaffe/laravel-mail-log-channel) | ||
[![StyleCI](https://github.styleci.io/repos/147424037/shield?branch=master)](https://github.styleci.io/repos/147424037) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
|
||
A service provider to add support for logging via email using Laravels built-in mail provider | ||
A service provider to add support for logging via email using Laravels built-in mail provider. | ||
|
||
This package is a fork of [laravel-log-mailer](https://packagist.org/packages/designmynight/laravel-log-mailer) by Steve Porter. | ||
|
||
**This fork introduces some breaking changes. If you're upgrading from it, please follow the [configuration](#configuration) bellow.** | ||
|
||
![image](https://user-images.githubusercontent.com/12199424/45576336-a93c1300-b86e-11e8-9575-d1e4c5ed5dec.png) | ||
|
||
|
@@ -18,69 +22,76 @@ Table of contents | |
Installation | ||
------------ | ||
|
||
Installation using composer: | ||
You can install this package via composer using this commande: | ||
|
||
```sh | ||
composer require designmynight/laravel-log-mailer | ||
composer require shaffe/laravel-mail-log-channel | ||
``` | ||
|
||
|
||
### Laravel version Compatibility | ||
|
||
Laravel | Package | | ||
:---------|:--------| | ||
7.x | 2.0.x | | ||
6.x | 2.0.x | | ||
5.6.x | 1.0.x | | ||
|
||
And add the service provider in `config/app.php`: | ||
|
||
```php | ||
DesignMyNight\Laravel\Logging\MailableLogServiceProvider::class, | ||
``` | ||
|
||
The package will automatically register itself if you use Laravel. | ||
|
||
For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`. | ||
|
||
```php | ||
$app->register(DesignMyNight\Laravel\Logging\MailableLogServiceProvider::class); | ||
$app->register(Shaffe\MailLogChannel\MailLogChannelServiceProvider::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: | ||
|
||
To ensure all unhandled exceptions are mailed, set up a mail logging channel and add it to your logging stack in config/logging.php: | ||
1. create a `mail` logging channel in `config/logging.php`, | ||
2. add this `mail` channel to your current logging stack, | ||
3. add a `LOG_MAIL_ADDRESS` to your `.env` file to define the recipient. | ||
|
||
```php | ||
'channels' => [ | ||
'stack' => [ | ||
'driver' => 'stack', | ||
// Add mail to the stack: | ||
// 2. Add mail to the stack: | ||
'channels' => ['single', 'mail'], | ||
], | ||
|
||
// ... | ||
|
||
// Create a mail logging channel: | ||
// 1. Create a mail logging channel: | ||
'mail' => [ | ||
'driver' => 'mail', | ||
'level' => env('LOG_MAIL_LEVEL', 'notice'), | ||
|
||
// Specify who to mail the log to | ||
'to' => [ | ||
[ | ||
'address' => '[email protected]', | ||
'address' => env('LOG_MAIL_ADDRESS'), | ||
'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 sender. | ||
// Default is config('mail.from.address') and config('mail.from.name') | ||
// 'from' => [ | ||
// 'address' => env('LOG_MAIL_ADDRESS'), | ||
// 'name' => 'Errors' | ||
// ], | ||
|
||
// Optionally overwrite the subject format pattern | ||
// 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'), | ||
|
||
// Optionally overwrite the mailable template | ||
// Two variables are sent to the view: `string $content` and `array $records` | ||
// 'mailable' => NewLogMailable::class | ||
], | ||
], | ||
``` | ||
|
||
You can specify multiple channels and change the recipients and customise the email template per channel. | ||
|
||
You can specify multiple channels and change the recipients and customize the email template per channel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
{ | ||
"name": "designmynight/laravel-log-mailer", | ||
"name": "shaffe/laravel-mail-log-channel", | ||
"description": "A package to support logging via email in Laravel", | ||
"homepage": "https://github.com/designmynight/laravel-log-mailer", | ||
"homepage": "https://github.com/shaffe-fr/laravel-mail-log-channel", | ||
"license": "MIT", | ||
"keywords": [ | ||
"laravel", | ||
"laravel-logging", | ||
"logging", | ||
"mail channel", | ||
"laravel-log-mailer", | ||
"monolog", | ||
"designmynight" | ||
"laravel-mail-log-channel", | ||
"shaffe" | ||
], | ||
"require": { | ||
"illuminate/support": "^5.6" | ||
"illuminate/bus": "^5.6|^6.0|^7.0", | ||
"illuminate/contracts": "^5.6|^6.0|^7.0", | ||
"illuminate/log": "^5.6|^6.0|^7.0", | ||
"illuminate/mail": "^5.6|^6.0|^7.0", | ||
"illuminate/queue": "^5.6|^6.0|^7.0", | ||
"illuminate/support": "^5.6|^6.0|^7.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"DesignMyNight\\Laravel\\": "src" | ||
"Shaffe\\MailLogChannel\\": "src" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Karel FAILLE", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Steve Porter", | ||
"email": "[email protected]", | ||
|
@@ -28,7 +40,7 @@ | |
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"DesignMyNight\\Laravel\\Logging\\MailableLogServiceProvider" | ||
"Shaffe\\MailLogChannel\\MailLogChannelServiceProvider" | ||
] | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.