diff --git a/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php b/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php index 29134115f3e6c..37e641c578f80 100644 --- a/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/SwiftMailerHandler.php @@ -12,6 +12,7 @@ namespace Symfony\Bridge\Monolog\Handler; use Monolog\Handler\SwiftMailerHandler as BaseSwiftMailerHandler; +use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\HttpKernel\Event\PostResponseEvent; /** @@ -43,6 +44,16 @@ public function onKernelTerminate(PostResponseEvent $event) $this->instantFlush = true; } + /** + * After the CLI application has been terminated we will always flush messages + * + * @param ConsoleTerminateEvent $event + */ + public function onCliTerminate(ConsoleTerminateEvent $event) + { + $this->instantFlush = true; + } + /** * {@inheritdoc} */
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: