I'm adding custom request handler using
register_rest_root. Sometimes it's hanging and I'm stuck without any output. I would like to use something like
to debug my code. But echo only outputs to the webpage source, which is not generated for failed request. How can I achieve this? If possible please advice solution which is applicable on the website already exposed to users.