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


PHP Logger::writesToFile方法代码示例

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


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

示例1: applicationlogAction

 /**
  * Display the application log
  */
 public function applicationlogAction()
 {
     if (!Logger::writesToFile()) {
         $this->httpNotFound('Page not found');
     }
     $this->addTitleTab('application log');
     $resource = new FileReader(new ConfigObject(array('filename' => Config::app()->get('logging', 'file'), 'fields' => '/(?<!.)(?<datetime>[0-9]{4}(?:-[0-9]{2}){2}' . 'T[0-9]{2}(?::[0-9]{2}){2}(?:[\\+\\-][0-9]{2}:[0-9]{2})?)' . ' - (?<loglevel>[A-Za-z]+) - (?<message>.*)(?!.)/msS')));
     $this->view->logData = $resource->select()->order('DESC');
     $this->setupLimitControl();
     $this->setupPaginationControl($this->view->logData);
 }
开发者ID:JakobGM,项目名称:icingaweb2,代码行数:14,代码来源:ListController.php

示例2: getMenu

 /**
  * Return the app's menu
  *
  * @return  Navigation
  */
 public function getMenu()
 {
     if ($this->user !== null) {
         $menu = array('dashboard' => array('label' => t('Dashboard'), 'url' => 'dashboard', 'icon' => 'dashboard', 'priority' => 10), 'system' => array('label' => t('System'), 'icon' => 'services', 'priority' => 700, 'renderer' => array('SummaryNavigationItemRenderer', 'state' => 'critical'), 'children' => array('about' => array('label' => t('About'), 'url' => 'about', 'priority' => 701))), 'configuration' => array('label' => t('Configuration'), 'icon' => 'wrench', 'permission' => 'config/*', 'priority' => 800, 'children' => array('application' => array('label' => t('Application'), 'url' => 'config/general', 'permission' => 'config/application/*', 'priority' => 810), 'navigation' => array('label' => t('Shared Navigation'), 'url' => 'navigation/shared', 'permission' => 'config/application/navigation', 'priority' => 820), 'authentication' => array('label' => t('Authentication'), 'url' => 'config/userbackend', 'permission' => 'config/authentication/*', 'priority' => 830), 'roles' => array('label' => t('Roles'), 'url' => 'role/list', 'permission' => 'config/authentication/roles/show', 'priority' => 840), 'users' => array('label' => t('Users'), 'url' => 'user/list', 'permission' => 'config/authentication/users/show', 'priority' => 850), 'groups' => array('label' => t('Usergroups'), 'url' => 'group/list', 'permission' => 'config/authentication/groups/show', 'priority' => 860), 'modules' => array('label' => t('Modules'), 'url' => 'config/modules', 'permission' => 'config/modules', 'priority' => 890))), 'user' => array('label' => $this->user->getUsername(), 'icon' => 'user', 'priority' => 900, 'children' => array('preferences' => array('label' => t('Preferences'), 'url' => 'preference', 'priority' => 910), 'navigation' => array('label' => t('Navigation'), 'url' => 'navigation', 'priority' => 920), 'logout' => array('label' => t('Logout'), 'url' => 'authentication/logout', 'priority' => 990, 'renderer' => array('NavigationItemRenderer', 'target' => '_self')))));
         if (Logger::writesToFile()) {
             $menu['system']['children']['application_log'] = array('label' => t('Application Log'), 'url' => 'list/applicationlog', 'priority' => 710);
         }
     } else {
         $menu = array();
     }
     return Navigation::fromArray($menu)->load('menu-item');
 }
开发者ID:ZipRecruiter,项目名称:icingaweb2,代码行数:17,代码来源:Web.php

示例3: getMenu

 /**
  * Return the app's menu
  *
  * @return  Navigation
  */
 public function getMenu()
 {
     if ($this->user !== null) {
         $menu = array('dashboard' => array('label' => t('Dashboard'), 'url' => 'dashboard', 'icon' => 'dashboard', 'priority' => 10), 'system' => array('label' => t('System'), 'icon' => 'services', 'priority' => 700, 'renderer' => array('SummaryNavigationItemRenderer', 'state' => 'critical'), 'children' => array('about' => array('label' => t('About'), 'url' => 'about', 'priority' => 700), 'announcements' => array('label' => t('Announcements'), 'url' => 'announcements', 'priority' => 710))), 'configuration' => array('label' => t('Configuration'), 'icon' => 'wrench', 'permission' => 'config/*', 'priority' => 800, 'children' => array('application' => array('label' => t('Application'), 'url' => 'config/general', 'permission' => 'config/application/*', 'priority' => 810), 'authentication' => array('label' => t('Authentication'), 'permission' => 'config/authentication/*', 'priority' => 830, 'url' => 'role/list'), 'navigation' => array('label' => t('Shared Navigation'), 'url' => 'navigation/shared', 'permission' => 'config/application/navigation', 'priority' => 840), 'modules' => array('label' => t('Modules'), 'url' => 'config/modules', 'permission' => 'config/modules', 'priority' => 890))), 'user' => array('cssClass' => 'user-nav-item', 'label' => $this->user->getUsername(), 'icon' => 'user', 'priority' => 900, 'children' => array('account' => array('label' => t('My Account'), 'priority' => 100, 'url' => 'account'), 'logout' => array('label' => t('Logout'), 'priority' => 200, 'attributes' => array('target' => '_self'), 'url' => 'authentication/logout'))));
         if (Logger::writesToFile()) {
             $menu['system']['children']['application_log'] = array('label' => t('Application Log'), 'url' => 'list/applicationlog', 'permission' => 'application/log', 'priority' => 900);
         }
     } else {
         $menu = array();
     }
     return Navigation::fromArray($menu)->load('menu-item');
 }
开发者ID:0svald,项目名称:icingaweb2,代码行数:17,代码来源:Web.php

示例4: addMainMenuItems

 /**
  * Add Applications Main Menu Items
  */
 protected function addMainMenuItems()
 {
     $auth = Manager::getInstance();
     if ($auth->isAuthenticated()) {
         $this->add(t('Dashboard'), array('url' => 'dashboard', 'icon' => 'dashboard', 'priority' => 10));
         $section = $this->add(t('System'), array('icon' => 'services', 'priority' => 700, 'renderer' => 'ProblemMenuItemRenderer'));
         $section->add(t('About'), array('url' => 'about', 'priority' => 701));
         if (Logger::writesToFile()) {
             $section->add(t('Application Log'), array('url' => 'list/applicationlog', 'priority' => 710));
         }
         $section = $this->add(t('Configuration'), array('icon' => 'wrench', 'permission' => 'config/*', 'priority' => 800));
         $section->add(t('Application'), array('url' => 'config', 'permission' => 'config/application/*', 'priority' => 810));
         $section->add(t('Authentication'), array('url' => 'config/userbackend', 'permission' => 'config/authentication/*', 'priority' => 820));
         $section->add(t('Roles'), array('url' => 'role/list', 'permission' => 'config/authentication/roles/show', 'priority' => 830));
         $section->add(t('Users'), array('url' => 'user/list', 'permission' => 'config/authentication/users/show', 'priority' => 840));
         $section->add(t('Usergroups'), array('url' => 'group/list', 'permission' => 'config/authentication/groups/show', 'priority' => 850));
         $section->add(t('Modules'), array('url' => 'config/modules', 'permission' => 'config/modules', 'priority' => 890));
         $section = $this->add($auth->getUser()->getUsername(), array('icon' => 'user', 'priority' => 900));
         $section->add(t('Preferences'), array('url' => 'preference', 'priority' => 910));
         $section->add(t('Logout'), array('url' => 'authentication/logout', 'priority' => 990, 'renderer' => 'ForeignMenuItemRenderer'));
     }
 }
开发者ID:hsanjuan,项目名称:icingaweb2,代码行数:25,代码来源:Menu.php


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