Skip to content

Commit

Permalink
Merge pull request #4 from designmynight/3
Browse files Browse the repository at this point in the history
fix: fix logging levels
  • Loading branch information
Steve Porter authored Sep 9, 2018
2 parents fa60dd0 + fb42fbb commit b889365
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to `laravel-log-mailer` will be documented in this file

## 1.0.2 - 2018-09-09
- fix logging levels

## 1.0.1 - 2018-09-05
- fix dependancy

Expand Down
4 changes: 3 additions & 1 deletion src/Logging/Driver/MailableLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public function __invoke(array $config)

$mailHandler = new MailableHandler(
$this->buildMailable(),
$this->subjectFormatter()
$this->subjectFormatter(),
$this->config('level'),
$this->config('bubble')
);

$mailHandler->setFormatter(new HtmlFormatter());
Expand Down
6 changes: 5 additions & 1 deletion src/Logging/Monolog/Handlers/MailableHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Mail\Mailable;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\MailHandler;
use Monolog\Logger;

class MailableHandler extends MailHandler
{
Expand All @@ -13,11 +14,14 @@ class MailableHandler extends MailHandler
*
* @param Mailable $mailable
* @param LineFormatter $subjectFormatter
* @param int $level The minimum logging level at which this handler will be triggered
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
*
* @return void
*/
public function __construct(Mailable $mailable, LineFormatter $subjectFormatter)
public function __construct(Mailable $mailable, LineFormatter $subjectFormatter, $level = Logger::DEBUG, $bubble = true)
{
parent::__construct($level, $bubble);
$this->mailer = app()->make('mailer');
$this->subjectFormatter = $subjectFormatter;
$this->mailable = $mailable;
Expand Down

0 comments on commit b889365

Please sign in to comment.