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