zend-log

Hooking into the Error processing cycle

给你一囗甜甜゛ 提交于 2020-01-14 05:16:56
问题 I'm building a monitoring solution for logging PHP errors, uncaught exceptions and anything else the user wants to log to a database table. Kind of a replacement for the Monitoring solution in the commercial Zend Server. I've written a Monitor class which extends Zend_Log and can handle all the mentioned cases. My aim is to reduce configuration to one place, which would be the Bootstrap. At the moment I'm initializing the monitor like this: protected function _initMonitor() { $config = Zend

Log each request in ZF2

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 03:44:06
问题 We are using zend framework 2 for a new application, i would like to have the same logging system of Rails or similar, i would like have a log for each request, is possible to do this in Zend? 回答1: It depends what you want to log. If it is just an access log, you should try to use the webserver's log. The logs from Apache/nginx/IIS etc perform better than you will achieve in your ZF2 app. If you need to log inside the ZF2 application, you have two choices. First option is at bootstrap . It's

FirePHP doesn't always write log messages

纵然是瞬间 提交于 2019-12-12 18:39:28
问题 I set my loggers up in my Bootstrap.php like so: $logger = new Zend_Log(); if($environment->debug == '1') { $stream = @fopen('/var/www/html/rta/rta.log','a',false); if(!$stream){ throw new Exception('Failed to open log stream'); } $writer = new Zend_Log_Writer_Stream($stream); $logger->addWriter($writer); $logger->addWriter(new Zend_Log_Writer_Firebug()); } else { // Do something else } Zend_Registry::set('logger',$logger); I have the following code that I set up to fail: $data = array(