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

[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
Loading
Loading
Loading
Loading
+6 −3
Changes for Classes/WE/SwiftMailerSpool/Command/SwiftMailerSpoolCommandController.php: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -65,11 +65,14 @@ class SwiftMailerSpoolCommandController extends CommandController {
		}
		$failedRecipients = array();
		$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);
		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');
		}
	}

}