diff --git a/lib/Cake/Network/Email/CakeEmail.php b/lib/Cake/Network/Email/CakeEmail.php index 09cc258cc..c6fbd0158 100644 --- a/lib/Cake/Network/Email/CakeEmail.php +++ b/lib/Cake/Network/Email/CakeEmail.php @@ -943,7 +943,11 @@ class CakeEmail { } $contents = $this->transportClass()->send($this); if (isset($this->_config['log']) && $this->_config['log']) { - CakeLog::write(LOG_DEBUG, '\nHeaders:\n' . $contents['headers'] . 'Message:\n' . $contents['message']); + $level = LOG_DEBUG; + if ($this->_config['log'] !== true) { + $level = $this->_config['log']; + } + CakeLog::write($level, PHP_EOL . $contents['headers'] . PHP_EOL . $contents['message']); } return $contents; }