Support the ongoing development of Laravel.io →
Mail Queues Architecture

I would like to see pretended mails body in chrome console on localhost.

What I did :

  • extended Illuminate\Mail\Mailer and added logging of mail body in logMessage method by overriding it,
  • created and registered provider usind my custom Mailer
  • pushed ChromePhp handler to monolog ($monolog->pushHandler(new Monolog\Handler\ChromePHPHandler(), 0);)

Outcome :

  • logging in controllers works fine - logs are displayed in chrome console
  • logging of mails works only in file, not in console
  • when I add dd("die") after logging in my custom mailer, logs are displayed in console correctly

Is there something that could prevent handling log event from one of handlers when no errors/exceptions were displayed? Or am I missing something?

Thanks,

Martin

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

matohavo matohavo Joined 19 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.