当前位置: 首页>>代码示例>>PHP>>正文


PHP LogUtil::getLogFileName方法代码示例

本文整理汇总了PHP中LogUtil::getLogFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP LogUtil::getLogFileName方法的具体用法?PHP LogUtil::getLogFileName怎么用?PHP LogUtil::getLogFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LogUtil的用法示例。


在下文中一共展示了LogUtil::getLogFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setupLoggers

 /**
  * Establish the necessary instances for logging.
  *
  * Implements 'core.init' event when Zikula_Core::STAGE_CONFIG.
  *
  * @param Zikula_Event $event The event to log.
  *
  * @return void
  */
 public function setupLoggers(Zikula_Event $event)
 {
     if (!($event['stage'] & Zikula_Core::STAGE_CONFIG)) {
         return;
     }
     if (!$this->serviceManager['log.enabled']) {
         return;
     }
     if ($this->serviceManager['log.to_display'] || $this->serviceManager['log.sql.to_display']) {
         $displayLogger = $this->serviceManager->attachService('zend.logger.display', new Zend_Log());
         // load writer first because of hard requires in the Zend_Log_Writer_Stream
         $writer = new Zend_Log_Writer_Stream('php://output');
         $formatter = new Zend_Log_Formatter_Simple('%priorityName% (%priority%): %message% <br />' . PHP_EOL);
         $writer->setFormatter($formatter);
         $displayLogger->addWriter($writer);
     }
     if ($this->serviceManager['log.to_file'] || $this->serviceManager['log.sql.to_file']) {
         $fileLogger = $this->serviceManager->attachService('zend.logger.file', new Zend_Log());
         $filename = LogUtil::getLogFileName();
         // load writer first because of hard requires in the Zend_Log_Writer_Stream
         $writer = new Zend_Log_Writer_Stream($filename);
         $formatter = new Zend_Log_Formatter_Simple('%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL);
         $writer->setFormatter($formatter);
         $fileLogger->addWriter($writer);
     }
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:35,代码来源:SystemListeners.php


注:本文中的LogUtil::getLogFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。