Skip to content

Commit

Permalink
Merge pull request #73 from arodiss/send-error-logs-from-cli-arodiss
Browse files Browse the repository at this point in the history
[SwiftMailer] send error log mails from CLI
  • Loading branch information
Seldaek committed Mar 26, 2014
2 parents 78ef133 + f4cb397 commit 60aa10d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DependencyInjection/MonologExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
$message->addMethodCall('setTo', array($handler['to_email']));
$message->addMethodCall('setSubject', array($handler['subject']));

if(isset($handler['mailer'])){
if(isset($handler['mailer'])){
$mailer = $handler['mailer'];
} else {
$mailer = 'mailer';
Expand All @@ -341,6 +341,9 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
if (!$oldHandler) {
$this->swiftMailerHandlers[] = $handlerId;
$definition->addTag('kernel.event_listener', array('event' => 'kernel.terminate', 'method' => 'onKernelTerminate'));
if (method_exists($newHandlerClass, 'onCliTerminate')) {
$definition->addTag('kernel.event_listener', array('event' => 'console.terminate', 'method' => 'onCliTerminate'));
}
}
break;

Expand Down

0 comments on commit 60aa10d

Please sign in to comment.