diff --git a/lib/SimpleSAML/Logger/StandardError.php b/lib/SimpleSAML/Logger/StandardError.php
new file mode 100644
index 0000000000000000000000000000000000000000..62eb8acc890cb7cb4df8a31ce1b0e452e53ee8ba
--- /dev/null
+++ b/lib/SimpleSAML/Logger/StandardError.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 StandardError extends \SimpleSAML_Logger_LoggingHandlerFile
+{
+
+    /**
+     * StandardError constructor.
+     *
+     * It runs the parent constructor and sets the log file to be the standard error descriptor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->logFile = 'php://stderr';
+    }
+}