craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 57 forks source link

Profiling and debug toolbar on element API endpoints #132

Closed jamealg closed 4 years ago

jamealg commented 4 years ago

Is there any conceivable way to access the debug toolbar on element API endpoints? I'm wondering if there is a best practice for profiling with element API.

jamealg commented 4 years ago

I found out that accessing /debug will take you to Yii's debugger and from there it's possible to find logs for requests to Element API endpoints. It's slightly less convenient but it works. If there were an option to return element API endpoints as HTML with the Yii debug toolbar that would be a wonderful feature to make profiling easier.

brandonkelly commented 3 years ago

If you’re logged into an account that has the Debug Toolbar enabled for front-end requests, Element API requests will come back with a X-Debug-Link header, set to a URL where you can view the debug toolbar report for that request.