Esempio n. 1
0
 public function __construct($enabled = false)
 {
     parent::__construct($enabled);
     $this->_log = new Zend_Log();
     $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../data/log/db-queries.log');
     $this->_log->addWriter($writer);
 }
Esempio n. 2
0
 public function __construct($enabled = false)
 {
     parent::__construct($enabled);
     $stream = @fopen(BASE_PATH . '/data/logs/db-queries.log', 'w', false);
     if (!$stream) {
         throw new App_Exception('Failed to open stream');
     }
     $writer = new Zend_Log_Writer_Stream($stream);
     $this->_log = new Zend_Log($writer);
 }
Esempio n. 3
0
 public function __construct($enable)
 {
     parent::__construct($enable);
     $writer = new Kwf_Log_Writer_Stream(APP_PATH . '/querylog', 'w');
     $writer->setFormatter(new Zend_Log_Formatter_Simple("%message%\n"));
     $this->_logger = new Zend_Log($writer);
     /*
     foreach (new DirectoryIterator('/tmp') as $item) {
         if (substr($item->getFilename(), 0, 9) == 'querylog.') {
             $time = (int)(substr($item->getFilename(), 9, -2));
             if (time()-$time > 15*60) {
                 @unlink($item->getPathname());
             }
         }
     }
     */
 }
Esempio n. 4
0
 public function Monkeys_Db_Profiler()
 {
     parent::__construct(true);
 }