Commit 9c740b7e authored by Simon Gadient's avatar Simon Gadient

[IMP] Enhanced the logging in flush command

Only log to Debug in case no mails are sent, so that the log does not
get swamped.

refs KIME-3340
parent 8a5834ad
...@@ -65,11 +65,14 @@ class SwiftMailerSpoolCommandController extends CommandController { ...@@ -65,11 +65,14 @@ class SwiftMailerSpoolCommandController extends CommandController {
} }
$failedRecipients = array(); $failedRecipients = array();
$sent = $spool->flushQueue($realTransport, $failedRecipients); $sent = $spool->flushQueue($realTransport, $failedRecipients);
$this->logger->log($sent . ' mails sent.'); if ($sent > 0) {
$this->logger->log($sent . ' messages sent.', LOG_INFO, NULL, 'SwiftMailerSpool');
} else {
$this->logger->log('No messages sent.', LOG_DEBUG, 'SwiftMailerSpool');
}
$count = count($failedRecipients); $count = count($failedRecipients);
if ($count > 0) { if ($count > 0) {
$this->logger->log($count . ' recipients failed. Check the spool to see the messages.', LOG_WARNING); $this->logger->log($count . ' recipients failed. Check the spool if messages got stuck.', LOG_WARNING, 'SwiftMailerSpool');
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment