Sending log to Firebug while you're sending JSON data via the JSON action helper (see:
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelpers.json) is actually (ZF 1.7.0, FirePHP 0.2.1) a bit problematic.
The argument is discussed around (mostly at
http://framework.zend.com/issues/browse/ZF-4202).
Keeping all together, the actual simplest working way to make it properly work is:
function jsonAction()
{
// your code here, assuming that it produces some $data
// probably you created a logger in some bootstrap step
$FirePhpLogger = Zend_Registry::get('logger');
/*
Since the JSON helper sends its response very early and then exit,
the logic below vanish the FirePHP logger.
*/
//$this->_helper->json($data);
/*
Suppressing the exit, the JSON helper (in ZF 1.7.0) will disable
the response sending and will NOT exit
*/
$json = $this->getHelper('Json');
$json->suppressExit = true;
$json->sendJson($data);
$FirePhpLogger->log($json->encodeJson($data), Zend_Log::INFO);
}
That's all.
Regards,
HUjuice