From 4f6603e2b16a168712f89ef8b6c242a23938de35 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 30 May 2015 19:10:16 -0400 Subject: Add debugging log to record the time to send an email --- app/Model/Notification.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/Model') diff --git a/app/Model/Notification.php b/app/Model/Notification.php index 5835de54..048b6a39 100644 --- a/app/Model/Notification.php +++ b/app/Model/Notification.php @@ -114,6 +114,7 @@ class Notification extends Base foreach ($users as $user) { $this->container['logger']->debug('Send email notification to '.$user['username'].' lang='.$user['language']); + $start_time = microtime(true); // Use the user language otherwise use the application language (do not use the session language) if (! empty($user['language'])) { @@ -131,6 +132,8 @@ class Notification extends Base ->setTo(array($user['email'] => $user['name'] ?: $user['username'])); $mailer->send($message); + + $this->container['logger']->debug('Email sent in '.round(microtime(true) - $start_time, 6).' seconds'); } } catch (Swift_TransportException $e) { -- cgit v1.2.3