summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2016-04-01 16:11:07 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2016-04-01 16:11:07 +0200
commited884a147df25e7edc00ff7ede59c3adb763ca14 (patch)
tree36275787c27a6d8229bcc3bedbe602f608290933 /lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
parent1d5b596ab432dc3db2351d3f67743fcbe16dbfeb (diff)
downloadsimplesamlphp-ed884a147df25e7edc00ff7ede59c3adb763ca14.zip
simplesamlphp-ed884a147df25e7edc00ff7ede59c3adb763ca14.tar.gz
simplesamlphp-ed884a147df25e7edc00ff7ede59c3adb763ca14.tar.bz2
Migrate all the logging handlers to namespaces. Make SimpleSAML\Logger a bit more intelligent so that it allows using custom logging handlers. Now you just need to implement SimpleSAML\Logger\LogginghandlerInterface in a class, and set the 'logging.handler' option in the configuration file to a string with the full name of your class.
Diffstat (limited to 'lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php')
-rw-r--r--lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php b/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
new file mode 100644
index 0000000..0f35fcf
--- /dev/null
+++ b/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace SimpleSAML\Logger;
+
+/**
+ * A logging handler that outputs all messages to standard error.
+ *
+ * @author Jaime Perez Crespo, UNINETT AS <jaime.perez@uninett.no>
+ * @package SimpleSAMLphp
+ */
+class StandardErrorLoggingHandler extends FileLoggingHandler
+{
+
+ /**
+ * StandardError constructor.
+ *
+ * It runs the parent constructor and sets the log file to be the standard error descriptor.
+ */
+ public function __construct(\SimpleSAML_Configuration $config)
+ {
+ $this->processname = $config->getString('logging.processname', 'SimpleSAMLphp');
+ $this->logFile = 'php://stderr';
+ }
+}