Last active
January 30, 2016 00:21
-
-
Save bradjones1/f8c16d640ca8d1f2d559 to your computer and use it in GitHub Desktop.
Log simplesamlphp error info to syslog, for cross-reference to trackID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class error_show | |
* | |
* A custom error show method to log some useful additional information. | |
*/ | |
class error_show { | |
public static function show($config, $data) { | |
$additional = $data['error'] + ['cookie-headers' => $_COOKIE]; | |
unset($additional['exceptionMsg']); | |
unset($additional['exceptionTrace']); | |
$debug = new SimpleSAML_Logger_LoggingHandlerSyslog; | |
$debug->setArray($additional); | |
$debug->setLogFormat('json'); | |
$debug->log(SimpleSAML_Logger::NOTICE, ''); | |
$t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors'); | |
$t->data = array_merge($t->data, $data); | |
$t->show(); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends on PR simplesamlphp/simplesamlphp#311