當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Log::info方法代碼示例

本文整理匯總了PHP中Zend_Log::info方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Log::info方法的具體用法?PHP Zend_Log::info怎麽用?PHP Zend_Log::info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Log的用法示例。


在下文中一共展示了Zend_Log::info方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testWrite

 public function testWrite()
 {
     $this->log->err('123');
     $this->log->info('123');
     $count = $this->rediska->getListLength('log');
     $this->assertEquals(2, $count);
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:7,代碼來源:WriterTest.php

示例2: queryStart

 /**
  * Obsługa rozpoczęcia kwerendy .
  * 
  * @param type $queryText
  * @param type $queryType
  * @return type 
  */
 public function queryStart($queryText, $queryType = null)
 {
     $queryId = parent::queryStart($queryText);
     if ($this->getEnabled()) {
         $message = "SQL({$queryId}): " . $queryText;
         // log the message as INFO message
         $this->_log->info($message);
     }
     return $queryId;
 }
開發者ID:Webowiec,項目名稱:zendnote,代碼行數:17,代碼來源:SqlLogger.php

示例3: __construct

 /**
  *
  * @throws Opus_SolrSearch_Exception If connection to Solr server could not be established.
  */
 public function __construct()
 {
     $this->log = Zend_Registry::get('Zend_Log');
     $this->config = Zend_Registry::get('Zend_Config');
     $this->solr_server = $this->getSolrServer();
     if (false === $this->solr_server->ping()) {
         $this->log->err('Connection to Solr server ' . $this->solr_server_url . ' could not be established.');
         throw new Opus_SolrSearch_Exception('Solr server ' . $this->solr_server_url . ' is not responding.', Opus_SolrSearch_Exception::SERVER_UNREACHABLE);
     }
     $this->log->info('Connection to Solr server ' . $this->solr_server_url . ' was successfully established.');
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:15,代碼來源:Searcher.php

示例4: addItem

 public static function addItem($message, $error = false)
 {
     global $s1b;
     if (self::getConfig()->getTracesEnabled() || self::getConfig()->getLogsEnabled()) {
         if (!strlen(trim($message))) {
             throw new \Exception('Cannot insert empty trace.');
         }
         // Ecriture du message dans le tableau des items en sessions si traces activées
         if (self::getConfig()->getTracesEnabled()) {
             self::initItems();
             self::$items[] = $message;
         }
         // Ecriture du log si activé
         if (self::getConfig()->getLogsEnabled()) {
             // vérification de l'existence du fichier et création si non existant
             $now = new \DateTime();
             $logFilePath = self::getContext()->getBaseDirectory() . sprintf("/var/log/%s-log.txt", $now->format("Ymd"));
             if (!file_exists($logFilePath)) {
                 $file = fopen($logFilePath, "w");
                 fclose($file);
             }
             // ecriture du log dans le fichier
             $writer = new \Zend_Log_Writer_Stream($logFilePath);
             $logger = new \Zend_Log($writer);
             if ($error) {
                 $logger->err($message);
             } else {
                 $logger->info($message);
             }
             $logger = null;
         }
     }
 }
開發者ID:berliozd,項目名稱:cherbouquin,代碼行數:33,代碼來源:Trace.php

示例5: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     // get profile of the current query
     $profile = $this->getQueryProfile($queryId);
     // update totalElapsedTime counter
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     // create the message to be logged
     $message = "\nElapsed Secs: " . round($profile->getElapsedSecs(), 5) . "\n";
     $message .= "Query: " . $profile->getQuery() . "\n";
     // log the message as INFO message
     $this->_log->info($message);
 }
開發者ID:MichaelGogeshvili,項目名稱:sitewatch,代碼行數:23,代碼來源:Log.php

示例6: work

 /**
  * Load a document from database and optional file(s) and index them,
  * or remove document from index (depending on job)
  *
  * @param Opus_Job $job Job description and attached data.
  * @return void
  */
 public function work(Opus_Job $job)
 {
     // make sure we have the right job
     if ($job->getLabel() != $this->getActivationLabel()) {
         throw new Opus_Job_Worker_InvalidJobException($job->getLabel() . " is not a suitable job for this worker.");
     }
     $this->_job = $job;
     $data = $job->getData();
     if (!(is_object($data) && isset($data->documentId) && isset($data->task))) {
         throw new Opus_Job_Worker_InvalidJobException("Incomplete or missing data.");
     }
     if (null !== $this->_logger) {
         $this->_logger->info('Indexing document with ID: ' . $data->documentId . '.');
     }
     // create index document or remove index, depending on task
     if ($data->task === 'index') {
         $document = new Opus_Document($data->documentId);
         $this->getIndex()->addDocumentToEntryIndex($document)->commit();
     } else {
         if ($data->task === 'remove') {
             $this->getIndex()->removeDocumentFromEntryIndexById($data->documentId)->commit();
         } else {
             throw new Opus_Job_Worker_InvalidJobException("unknown task '{$data->task}'.");
         }
     }
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:33,代碼來源:IndexOpusDocument.php

示例7: consume

 /**
  * Execute a job and remove it from the jobs table on success.
  *
  * @param Opus_Job $job Job description model.
  * @return boolean Returns true if a job is consumend false if not
  */
 protected function consume(Opus_Job $job)
 {
     $label = $job->getLabel();
     if ($job->getState() !== null) {
         return false;
     }
     if (array_key_exists($label, $this->_workers)) {
         $worker = $this->_workers[$label];
         if (null !== $this->_logger) {
             $this->_logger->info('Processing ' . $label);
         }
         $job->setState(Opus_Job::STATE_PROCESSING);
         $job->store();
         try {
             $worker->setLogger($this->_logger);
             $worker->work($job);
             $job->delete();
             sleep($this->_delay);
         } catch (Exception $ex) {
             if (null !== $this->_logger) {
                 $msg = get_class($worker) . ': ' . $ex->getMessage();
                 $this->_logger->err($msg);
             }
             $job->setErrors(json_encode(array('exception' => get_class($ex), 'message' => $ex->getMessage(), 'trace' => $ex->getTraceAsString())));
             $job->setState(Opus_Job::STATE_FAILED);
             $job->store();
             return false;
         }
         return true;
     }
     return false;
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:38,代碼來源:Runner.php

示例8: init

 public function init()
 {
     $writer = new Zend_Log_Writer_Firebug();
     $logger = new Zend_Log($writer);
     $logger->addPriority('LOGD', 8);
     $writer->setPriorityStyle(8, 'LOG');
     $logger->addPriority('ERROR', 9);
     $writer->setPriorityStyle(9, 'ERROR');
     $logger->addPriority('TRACE', 10);
     $writer->setPriorityStyle(10, 'TRACE');
     $logger->addPriority('EXCEPTION', 11);
     $writer->setPriorityStyle(11, 'EXCEPTION');
     $logger->addPriority('TABLE', 12);
     $writer->setPriorityStyle(12, 'TABLE');
     $logger->logd($_SERVER);
     $logger->info($_SERVER);
     $logger->warn($_SERVER);
     $logger->error($_SERVER);
     $logger->trace($_SERVER);
     try {
         throw new Exception('Test Exception');
     } catch (Exception $e) {
         $logger->exception($e);
     }
     $logger->table(array('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))));
 }
開發者ID:besters,項目名稱:My-Base,代碼行數:26,代碼來源:IndexController.php

示例9: _error

 protected function _error($message)
 {
     $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../data/log/cron_ERROR_' . $this->_name . '.log');
     $logger = new Zend_Log($writer);
     echo $message;
     $logger->info($message . "\n");
     return;
 }
開發者ID:n3r,項目名稱:parseKp,代碼行數:8,代碼來源:Abstract.php

示例10: _sendMessage

 /**
  * Send message to queue
  *
  * @param Oggetto_Messenger_Model_Message_Interface $message Message
  * @param string                                    $queue   Queue
  *
  * @return void
  */
 private function _sendMessage(Oggetto_Messenger_Model_Message_Interface $message, $queue)
 {
     $rabbitMessage = new AMQPMessage($message->toString(), array('delivery_mode' => 2));
     $this->_logger->info("Sending message to queue '{$queue}': {$rabbitMessage->body}");
     $transport = new Varien_Object();
     Mage::dispatchEvent('rabbitmq_publish_before', ['message' => $rabbitMessage, 'transport' => $transport]);
     $this->_getChannel()->basic_publish($rabbitMessage, '', $queue);
     Mage::dispatchEvent('rabbitmq_publish_after', ['message' => $rabbitMessage, 'transport' => $transport]);
 }
開發者ID:rockxcn,項目名稱:messenger,代碼行數:17,代碼來源:Rabbitmq.php

示例11: X_initDbCaches

 /**
  * Init the db metadata and paginator caches
  */
 protected function X_initDbCaches()
 {
     $this->_logger->info('Bootstrap ' . __METHOD__);
     if ('production' == $this->getEnvironment()) {
         // Metadata cache for Zend_Db_Table
         $frontendOptions = array('automatic_serialization' => true);
         $cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions);
         Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
     }
 }
開發者ID:shadobladez,項目名稱:erp2,代碼行數:13,代碼來源:Bootstrap.php

示例12: getLogger

 /**
  * lees de opties uit application.ini en maak een log-object aan dat in de
  * registry wordt gezet. Deze is vanuit de hele code te gebruiken voor debug-logging
  * @return Zend_Log
  */
 public function getLogger()
 {
     if (null === $this->_logger) {
         $options = $this->getOptions();
         if (!isset($options['debuglog'])) {
             throw new Exception("Debug log path undefined in application.ini");
         }
         try {
             $writer = new Zend_Log_Writer_Stream($options['debuglog']);
             $this->_logger = new Zend_Log($writer);
         } catch (Exception $e) {
             $this->_logger = null;
         }
         if (isset($options['firebug']) && "1" == $options['firebug']) {
             try {
                 $writer = new Zend_Log_Writer_Firebug();
                 if (null !== $this->_logger) {
                     $this->_logger->addWriter($writer);
                 } else {
                     $this->_logger = new Zend_Log($writer);
                 }
             } catch (Exception $e) {
                 $this->_logger = null;
             }
         }
         // voeg eventueel een uitvoer filter toe
         if (null !== $this->_logger && isset($options['loglevel'])) {
             try {
                 $loglevel = intVal($options['loglevel']);
                 $filter = new Zend_Log_Filter_Priority($loglevel);
                 $this->_logger->addFilter($filter);
             } catch (Exception $e) {
             }
         }
     }
     // voeg toe aan de registry zodat we deze later eenvoudig kunnen gebruiken
     if (null !== $this->_logger) {
         $this->_logger->info('==========================================================');
         Zend_Registry::set('logger', $this->_logger);
     }
     return $this->_logger;
 }
開發者ID:noureddineexcen,項目名稱:excen.orders.new,代碼行數:47,代碼來源:Logger.php

示例13: deleteDocsByQuery

 /**
  * Deletes all index documents that match the given query $query.  The
  * changes are not visible and a subsequent call to commit is required, to
  * make the changes visible.
  *
  * @param query
  * @throws Opus_SolrSearch_Index_Exception If delete by query $query failed.
  * @return void
  */
 public function deleteDocsByQuery($query)
 {
     try {
         $this->getSolrServer('index')->deleteByQuery($query);
         $this->log->info('deleted all docs that match ' . $query);
     } catch (Apache_Solr_Exception $e) {
         $msg = 'Error while deleting all documents that match query ' . $query;
         $this->log->err("{$msg} : " . $e->getMessage());
         throw new Opus_SolrSearch_Index_Exception($msg, 0, $e);
     }
 }
開發者ID:alexukua,項目名稱:opus4,代碼行數:20,代碼來源:Indexer.php

示例14: saveCdrDedicatorias

 public function saveCdrDedicatorias($resultado)
 {
     $name = date('YmdH');
     $datos = $this->registerCdr();
     $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../logs/cdr/' . $name . ".dedicatoria");
     $formatter = new Zend_Log_Formatter_Simple('%message%' . PHP_EOL);
     $writer->setFormatter($formatter);
     $log = new Zend_Log($writer);
     $mensaje = $datos['fecha'] . "," . $datos['hora'] . "," . $_SERVER['REMOTE_ADDR'] . "," . $datos['telefono'] . "," . 'perfil:' . $datos['perfil'] . "," . $resultado;
     $log->info($mensaje);
 }
開發者ID:josmel,項目名稱:DevelEntretenimientoEntel,代碼行數:11,代碼來源:ConfigPerfil.php

示例15: saveCdrBanners

 private function saveCdrBanners($datos, $id, $name)
 {
     $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../logs/cdr/' . $name . ".banners");
     // $writer = new Zend_Log_Writer_Stream('/var/log/portalwap/'.$name.".banners");
     $formatter = new Zend_Log_Formatter_Simple('%message%' . PHP_EOL);
     $writer->setFormatter($formatter);
     $log = new Zend_Log($writer);
     $banners = 'banner1.' . $datos['url'][0] . "," . 'banner2.' . $datos['url'][1] . "," . 'banner3.' . $datos['url'][2] . "," . 'banner4.' . $datos['url'][3] . "," . 'banner5.' . $datos['url'][4];
     $mensaje = $datos['fecha'] . "," . $datos['hora'] . "," . $_SERVER['REMOTE_ADDR'] . "," . $datos['telefono'] . ",perfil:" . $datos['perfil'] . "," . $banners;
     $log->info($mensaje);
 }
開發者ID:josmel,項目名稱:PortalWapMovistar,代碼行數:11,代碼來源:Cdr.php


注:本文中的Zend_Log::info方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。