summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SimpleSAML/Logger/LoggingHandlerSyslog.php')
-rw-r--r--lib/SimpleSAML/Logger/LoggingHandlerSyslog.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php
index 6c7ddfa..58fc183 100644
--- a/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php
+++ b/lib/SimpleSAML/Logger/LoggingHandlerSyslog.php
@@ -12,7 +12,7 @@
class SimpleSAML_Logger_LoggingHandlerSyslog implements SimpleSAML_Logger_LoggingHandler {
private $isWindows = false;
-
+
function __construct() {
$config = SimpleSAML_Configuration::getInstance();
assert($config instanceof SimpleSAML_Configuration);
@@ -31,6 +31,12 @@ class SimpleSAML_Logger_LoggingHandlerSyslog implements SimpleSAML_Logger_Loggin
openlog($processname, LOG_PID, $facility);
}
+
+ function setLogFormat($format) {
+ $this->format = $format;
+ }
+
+
function log_internal($level,$string) {
/*
* Changing log level to supported levels if OS is Windows
@@ -41,7 +47,14 @@ class SimpleSAML_Logger_LoggingHandlerSyslog implements SimpleSAML_Logger_Loggin
else
$level = LOG_INFO;
}
- syslog($level,$level.' '.$string);
+
+ $formats = array('%process', '%level');
+ $replacements = array('', $level);
+ $string = str_replace($formats, $replacements, $string);
+ $string = preg_replace('/%\w+(\{[^\}]+\})?/', '', $string);
+ $string = trim($string);
+
+ syslog($level, $string);
}
}
?> \ No newline at end of file