You are not logged in.
Pages: 1
Any one know how to set up zend log. This is what i have in the bootstrap
protected function _initLogging()
{
$this->bootstrap('frontController');
$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::CRIT);
$logger->addFilter($filter);
}*/
$this->_logger = $logger;
Zend_Registry::set('log', $logger);
}However im not really sure how to call it in my other files.
$this->_logger->info('Bootstrap ' . __METHOD__);works if im calling in other bootstrap functions but not sure how to call outside of bootstrap.
Offline
Zend_Registry::get('log')->info('whatever text');
Since you set it to the Zend_Registry just retrieve it from there. Thats how I use translations.
Hope this helps!
Offline
Thanks. that worked!
Offline
Pages: 1