HH.
HH.

Reputation: 197

How to output Zend log information to chrome debugger console?

With Zend Framework 1.12 you can use Zend_Log_Writer_Firebug to write log information to the firebug console. Is there a way to pass the output to the chrome debugger console?

$logger = new Zend_Log();
$writer = 'production' == $this->getEnvironment() ? new Zend_Log_Writer_Stream(APPLICATION_PATH .'/../data/logs/app.log') : new Zend_Log_Writer_Firebug();

$logger->addWriter($writer);
if ('production' == $this->getEnvironment()) {
        $filter = new Zend_Log_Filter_Priority(Zend_Log::DEBUG);
        $logger->addFilter($filter);
}

$this->_logger = $logger;
Zend_Registry::set('log', $logger);
}

Upvotes: 0

Views: 1015

Answers (1)

Stephan Weinhold
Stephan Weinhold

Reputation: 1643

I am using Chrome Logger. It's a little bit more complicated than with Firebug but no big deal:

  1. install the extension for your Chrome browser
  2. include ChromePHP in your composer.json (that's the way I do it - if you have a different application include path, put it there)
  3. now you can use Zend\Log\Writer\ChromePHP to send debug-information to your Chrome-console.

Upvotes: 0

Related Questions