# How to alert admins if there is an error in a custom plugin?

**URL:** <https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364>\
**Category:** Development\
**Created:** [2017 年 9 月 19 日午後 1:44 UTC](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364 "2017-09-19T13:44:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2017 年 9 月 19 日午後 2:18 UTC](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364/2 "2017-09-19T14:18:47Z")

</div>

You can easily write errors to the logs visible at `<your forum>/logs`. If you want something more visible, you could consider putting some logic in your plugin that sends a PM to `@admins`.

[discourse-saved-searches](https://github.com/discourse/discourse-saved-searches/blob/master/app/jobs/regular/saved_search_notification.rb#L36) sends automated PMs from a plugin, so that’s probably a good place to start.

---

_[View the full topic](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364)._
