How to debug the app in production?

Hi there,

I need to deploy my app on Heroku. However, everything looks perfect except one thing: I cannot set debug to true in frontend/web/index.php – it’s because of Heroku. If you don’t understand me you can check it here: http://stackoverflow.com/questions/28259504/setup-yii2-advanced-on-heroku

site/error returns me:

and I cannot understand why this is happening because I cannot set debug to true. How do you handle these unknown exceptions in the production environment?

Also, I cannot go to logs because the app is on Heroku and I don’t have SSH or FTP access. I deploy the app by Git.

Thanks.

Hi

Always check runtime folder for error. i hope there you can check log trace out failure.

You need a custom log target that is compatible with Heroku’s logging system. Like this one.

In general, it’s a bad idea to enable debug toolbar at production.

Sure. But some times need to log user request to fix unexpected bugs and exceptions.
how yii-debug module works and why in production that stop log data?

But some times need to log user request to fix unexpected bugs and exceptions.

Write these into log.

how yii-debug module works and why in production that stop log data?

In order to collect useful data it is meant to be run in YII_DEBUG mode. That has very significant performance implications.

Also, if exposed, debug toolbar is a certain way to make your server very insecure.