-
-
Save b-durand/3056000 to your computer and use it in GitHub Desktop.
email log sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application.ini | |
resources.log.stream.writerName = "Mail" | |
resources.log.stream.writerParams.subjectPrependText = "website ERROR: " | |
resources.log.stream.writerParams.email = "info@example.com" | |
resources.log.stream.writerParams.replyto = "info@example.com" | |
resources.log.stream.writerParams.to = "me@example.com" | |
ErrorController.php | |
// Log exception, if logger available | |
if ($log = $this->getLog()) { | |
$log->log($this->view->message, $priority, $errors->exception); | |
$log->log('Request Parameters', $priority, $errors->request->getParams()); | |
} | |
Email Content | |
2012-07-05T13:47:49-05:00 NOTICE (5): Page not found | |
2012-07-05T13:47:49-05:00 NOTICE (5): Request Parameters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ErrorController.php
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->log($this->view->message, $priority, $errors->exception);
$log->log('Request Parameters', $priority, $errors->request->getParams());
}
=> see http://framework.zend.com/issues/browse/ZF-10427
The tips to solve this issue without patch the library is:
ErrorController.php
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->log($this->view->message . ': ' . $errors->exception, $priority);
$log->log('Request Parameters: ' . var_export($errors->request->getParams(), true), $priority);
}