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


PHP SimpleSAML_Logger::loggingHandler方法代码示例

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


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

示例1: createLoggingHandler

 private static function createLoggingHandler()
 {
     // set to FALSE to indicate that it is being initialized
     self::$loggingHandler = false;
     // get the configuration
     $config = SimpleSAML_Configuration::getInstance();
     assert($config instanceof SimpleSAML_Configuration);
     // get the metadata handler option from the configuration
     $handler = $config->getString('logging.handler', 'syslog');
     // setting minimum log_level
     self::$logLevel = $config->getInteger('logging.level', self::INFO);
     $handler = strtolower($handler);
     if ($handler === 'syslog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerSyslog();
     } elseif ($handler === 'file') {
         $sh = new SimpleSAML_Logger_LoggingHandlerFile();
     } elseif ($handler === 'errorlog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerErrorLog();
     } else {
         throw new Exception('Invalid value for the [logging.handler] configuration option. Unknown handler: ' . $handler);
     }
     self::$format = $config->getString('logging.format', self::$format);
     $sh->setLogFormat(self::$format);
     // set the session handler
     self::$loggingHandler = $sh;
 }
开发者ID:RKathees,项目名称:is-connectors,代码行数:26,代码来源:Logger.php

示例2: createLoggingHandler

 public static function createLoggingHandler()
 {
     /* Set to FALSE to indicate that it is being initialized. */
     self::$loggingHandler = FALSE;
     /* Get the configuration. */
     $config = SimpleSAML_Configuration::getInstance();
     assert($config instanceof SimpleSAML_Configuration);
     /* Get the metadata handler option from the configuration. */
     $handler = $config->getString('logging.handler', 'syslog');
     /*
      * setting minimum log_level
      */
     self::$logLevel = $config->getInteger('logging.level', LOG_INFO);
     $handler = strtolower($handler);
     if ($handler === 'syslog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerSyslog();
     } elseif ($handler === 'file') {
         $sh = new SimpleSAML_Logger_LoggingHandlerFile();
     } elseif ($handler === 'errorlog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerErrorLog();
     } else {
         throw new Exception('Invalid value for the [logging.handler] configuration option. Unknown handler: ' . $handler);
     }
     /* Set the session handler. */
     self::$loggingHandler = $sh;
 }
开发者ID:filonuse,项目名称:fedlab,代码行数:26,代码来源:Logger.php

示例3: createLoggingHandler

 public static function createLoggingHandler()
 {
     global $SIMPLESAML_INCPREFIX;
     /* Get the configuration. */
     $config = SimpleSAML_Configuration::getInstance();
     assert($config instanceof SimpleSAML_Configuration);
     /* Get the metadata handler option from the configuration. */
     $handler = $config->getValue('logging.handler', 'syslog');
     /*
      * setting minimum log_level
      */
     self::$logLevel = $config->getValue('logging.level', LOG_INFO);
     /* If 'session.handler' is NULL or unset, then we want
      * to fall back to the default PHP session handler.
      */
     if (is_null($handler)) {
         $handler = 'syslog';
     }
     /* The session handler must be a string. */
     if (!is_string($handler)) {
         throw new Exception('Invalid setting for the [logging.handler] configuration option. This option should be set to a valid string.');
     }
     $handler = strtolower($handler);
     if ($handler === 'syslog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerSyslog();
     } elseif ($handler === 'file') {
         $sh = new SimpleSAML_Logger_LoggingHandlerFile();
     } elseif ($handler === 'errorlog') {
         $sh = new SimpleSAML_Logger_LoggingHandlerErrorLog();
     } else {
         throw new Exception('Invalid value for the [logging.handler] configuration option. Unknown handler: ' . $handler);
     }
     /* Set the session handler. */
     self::$loggingHandler = $sh;
 }
开发者ID:stefanotirati,项目名称:moodle-google-apps,代码行数:35,代码来源:Logger.php


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