Debug option in the panel

I would like to be able to turn debug on and off from the panel. We do monthly deploys and I don’t have access to the main server so I want to turn debug on and off so I can catch the errors without having to tail apache. So I want to toggle debug true and false from the panel? Any solution for this would be awesome.

Thanks.

Hm, do you really want to enable debugging on the production server? That will affect all users of the website.

This might work:

  • In your site.yml, add a checkbox field debug.

  • In your config.php, define a variable $debugValue and assign it to the debug option.

    $debugValue = site()->debug() == '1'? true:false;
    c::set('debug', $debugValue);
    

(Note that you can’t use field methods like bool() here, because they are not available at this time, therefore I used the string comparison).

Edit: But as I said above, if debug is set to true on the production server, users visiting the site will see all errors. Maybe then just enable debugging for logged in users or the admin?