# 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:** 3

<div class="post-metadata">

**Author:** ![Bas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bas/32/294929_2.png) [@Bas](https://meta.discourse.org/u/Bas)\
**Post date:** [2017 年 9 月 20 日午前 8:23 UTC](https://meta.discourse.org/t/how-to-alert-admins-if-there-is-an-error-in-a-custom-plugin/70364/3 "2017-09-20T08:23:01Z")

</div>

> [@david](#):
>
> You can easily write errors to the logs visible at \<your forum\>/logs

How do you do this? 🙂  
Sorry if this sounds obtuse, I honestly searched quite a bit and can’t find anything about logging errors.  
As far as I know, the system can automatically send an email if there is too much logging, so that would actually be sufficient for our case.

 ![59](https://global.discourse-cdn.com/meta/original/3X/b/e/be821eeca954ca4e81ff3df3680ec6b6d2d5d5f9.png)

How do I post into the error log? Just raise an error? Or is there a specific Discourse.error class?

---

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