Created
July 5, 2012 19:29
-
-
Save anonymous/3055886 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