Debug info from request handler

I'm adding custom request handler using add_action and register_rest_root. Sometimes it's hanging and I'm stuck without any output. I would like to use something like

echo "Label";

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.

Topic endpoints logging debug Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.