# Logging / Email error notification

**URL:** <https://discuss.rubyonrails.org/t/logging-email-error-notification/68396>\
**Category:** rubyonrails-talk\
**Created:** [January 21, 2014, 3:24pm UTC](https://discuss.rubyonrails.org/t/logging-email-error-notification/68396 "2014-01-21T15:24:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Akins](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@Greg\_Akins](https://discuss.rubyonrails.org/u/Greg_Akins)\
**Post date:** [January 21, 2014, 3:24pm UTC](https://discuss.rubyonrails.org/t/logging-email-error-notification/68396/1 "2014-01-21T15:24:45Z")

</div>

I’d like to implement something in my application where the last n lines of the development log are included in an email when an error occurs.

Right now the application triggers an email using an application controller method that has be inserted into a rescue block.

Maybe I should just use “File” to grab the tail end of the development.log file and insert it into the email?

But I’m wondering if maybe there is a better approach or if anyone has a gem that does this automatically.

Greg Akins Insomnia Consulting, LLC [gakins@insomnia-consulting.org](mailto:gakins@insomnia-consulting.org)

724 454 7790 (cell) [http://www.linkedin.com/company/2942338?trk=tyah](http://www.linkedin.com/company/2942338?trk=tyah)

---

<div class="post-metadata">

**Author:** ![Prince](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/prince/32/958_2.png) [@Prince](https://discuss.rubyonrails.org/u/Prince)\
**Post date:** [January 21, 2014, 6:45pm UTC](https://discuss.rubyonrails.org/t/logging-email-error-notification/68396/2 "2014-01-21T18:45:00Z")

</div>

You could use exception\_notification gem for this. Link here [https://github.com/smartinez87/exception\_notification](https://github.com/smartinez87/exception_notification)
