Skip to content

Instantly share code, notes, and snippets.

Created July 5, 2012 19:29
Show Gist options
  • Save anonymous/3055886 to your computer and use it in GitHub Desktop.
Save anonymous/3055886 to your computer and use it in GitHub Desktop.
email log sample code
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