Plugin error logging

I’m building a plugin with a hook on Is there a way to log these errors somewhere so I can see what they are?

I’m using panel()->notify('xxx') to send me messages when all is good, but when something fails, I just get the smiley face on page save. How can I track down the errors?

edit: they aren’t showing up in my php error log in MAMP

You could try to output errors to the console using error_log(); Since debugging Kirby 2 hooks is not possible without workarounds, I have also just written stuff to file to check if I get the desired result.

1 Like

PS. There use to be a plugin, let me see if I can find it.

Here it is:

1 Like

Thanks for that link @texnixe I can’t get it to work in Kirby 2.5.7, but will continue with the error_log() check as you mentioned.

Hm, should actually work, but considering that it has been deprecated, I’m not sure.

If error_log doesn’t work, that I usually do is this:

f::write(kirby()->roots()->index().'/debug.txt', dump($whatever));

Thank you. It probably does work but I’m trying to load some plugin dependencies with Composer and not having much luck. I’ll be on Kirby 3 soon!