Send email to webmaster when errors occurs

Hello there,

I’m trying to handle errors with Kirby when my site is set to debug mode false.

c::set(‘debug’, false)

Is there a solution with Kirby to send email to webmaster when errors occurs on my website.

Something like a callback function where I can write my php code to send email !!

  • Is there a build in function in Kirby?

  • Do I have to write my own error handler?

  • What will be the best solution for monitoring errors when my site is live?

I’m using Kirby 2.5.8

Can you help me with that ?

English is not my first language. I hope you understand my question. :slight_smile:

The Kirby debug config setting is only a very brutal way to enforce debugging for development purposes.

Usually, you would set your error handling stuff in your php.ini. Instead of displaying errors on the page, errors should then get stored in a log file. You could then write a script to monitor this file and mail any errors (example, first I could find, guess there’s more if you google it)

There is no Kirby function that could take over here.

Maybe it would be possible to hook into Whoops somehow, but I don’t know if and how that is possible.

2 Likes