Skip to content

Instantly share code, notes, and snippets.

@bshaffer
Last active September 28, 2017 20:50
Show Gist options
  • Save bshaffer/3982788bb35ada1a447430292ffdb965 to your computer and use it in GitHub Desktop.
Save bshaffer/3982788bb35ada1a447430292ffdb965 to your computer and use it in GitHub Desktop.
<?php
use Google\Cloud\Logging\LoggingClient;
use Google\Cloud\ErrorReporting\Bootstrap;
$prev = set_exception_handler(function ($e) {
if (!class_exists(LoggingClient::class) || !class_exists(Bootstrap::class)) {
// autoload our own libraries
require_once('/sys/cloud_logging_autoloader.php');
}
$logging = new LoggingClient();
Bootstrap::$psrLogger = $logging->psrLogger();
Bootstrap::exceptionHandler($e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment