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