Log Help
Posted: Tue Jul 06, 2010 9:21 am
Hi there,
I need your help.
I don`t undertand how to use the logger in my application with Zend Framework 1.10.5
I have built the project with zf tools following the tutorial
Now I would like to set a log system.
in the bootstrap.php I have added this function
and in my IndexController.php
When I run the application I have a blank page.
Deleting the the application goes normally.
I am wondering how can I log to the file app.log and if I have to set some variables in the application.ini...like...[text]resources.logging.something...[/text]
I really appreciate your help.
Ziuccio
I need your help.
I don`t undertand how to use the logger in my application with Zend Framework 1.10.5
I have built the project with zf tools following the tutorial
Now I would like to set a log system.
in the bootstrap.php I have added this function
Code: Select all
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);
} ]
Code: Select all
public function indexAction()
{
$logger->debug('Test');
}Deleting the
Code: Select all
$logger->debug('Test'); I am wondering how can I log to the file app.log and if I have to set some variables in the application.ini...like...[text]resources.logging.something...[/text]
I really appreciate your help.
Ziuccio