本文整理汇总了PHP中false::setLogFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP false::setLogFormat方法的具体用法?PHP false::setLogFormat怎么用?PHP false::setLogFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类false
的用法示例。
在下文中一共展示了false::setLogFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createLoggingHandler
private static function createLoggingHandler($handler = null)
{
// set to false to indicate that it is being initialized
self::$loggingHandler = false;
// a set of known logging handlers
$known_handlers = array('syslog' => 'SimpleSAML\\Logger\\SyslogLoggingHandler', 'file' => 'SimpleSAML\\Logger\\FileLoggingHandler', 'errorlog' => 'SimpleSAML\\Logger\\ErrorLogLoggingHandler');
// get the configuration
$config = \SimpleSAML_Configuration::getInstance();
assert($config instanceof \SimpleSAML_Configuration);
// setting minimum log_level
self::$logLevel = $config->getInteger('logging.level', self::INFO);
// get the metadata handler option from the configuration
if (is_null($handler)) {
$handler = $config->getString('logging.handler', 'syslog');
}
if (class_exists($handler)) {
if (!in_array('SimpleSAML\\Logger\\LoggingHandlerInterface', class_implements($handler))) {
throw new \Exception("The logging handler '{$handler}' is invalid.");
}
} else {
$handler = strtolower($handler);
if (!array_key_exists($handler, $known_handlers)) {
throw new \Exception("Invalid value for the 'logging.handler' configuration option. Unknown handler '" . $handler . "''.");
}
$handler = $known_handlers[$handler];
}
self::$loggingHandler = new $handler($config);
self::$format = $config->getString('logging.format', self::$format);
self::$loggingHandler->setLogFormat(self::$format);
}