An often asked question in the CakePHP IRC channel is: “How can I enable [or disable] the debug messages for a certain action?” The answer to this question is simple (works in both CakePHP 1.1 and 1.2):

function action() {
    Configure::write('debug', '2');

    // do something
}

Please notice that the key must be in lowercase, ‘DEBUG’ won’t have the desired effect.

PS: I shut down the j.42dh.com password manager service as nobody used it ;-) A slightly modified version of the application can be downloaded from http://apps.42dh.com/jumpjump.