本文整理汇总了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);
}
}