25 $facility = $config->
getInteger(
'logging.facility', defined(
'LOG_LOCAL5') ? constant(
'LOG_LOCAL5') : LOG_USER);
27 $processname = $config->
getString(
'logging.processname',
'SimpleSAMLphp');
30 if (System::getOS() === System::WINDOWS) {
31 $this->isWindows =
true;
35 openlog($processname, LOG_PID, $facility);
56 public function log($level, $string)
59 if ($this->isWindows) {
67 $formats = array(
'%process',
'%level');
68 $replacements = array(
'', $level);
69 $string = str_replace(
$formats, $replacements, $string);
70 $string = preg_replace(
'/%\w+(\{[^\}]+\})?/',
'', $string);
71 $string = trim($string);
73 syslog($level, $string);
getInteger($name, $default=self::REQUIRED_OPTION)
This function retrieves an integer configuration option.
__construct(\SimpleSAML_Configuration $config)
Build a new logging handler based on syslog.
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
log($level, $string)
Log a message to syslog.
setLogFormat($format)
Set the format desired for the logs.