Skip to content

Instantly share code, notes, and snippets.

@jimmyz
Created August 6, 2015 19:51
Show Gist options
  • Save jimmyz/107c85f3c66e7345662a to your computer and use it in GitHub Desktop.
Save jimmyz/107c85f3c66e7345662a to your computer and use it in GitHub Desktop.
gedcomx-php Logging
<?php
require __DIR__ . '/../../vendor/autoload.php';
include 'functions.php';
use Gedcomx\Extensions\FamilySearch\Rs\Client\FamilySearchClient;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
session_start();
// create a log channel
$log = new Logger('fs-api');
$log->pushHandler(new StreamHandler(__DIR__ .'/../../logs/familysearch.log', Logger::DEBUG));
$clientOptions = array(
'environment' => 'sandbox',
'clientId' => 'a02j0000008LvUJAA0',
'redirectURI' => 'http://' . $_SERVER['HTTP_HOST'] . '/examples/OAuth2Code.php',
'logger' => $log
);
if(isset($_SESSION['fs_access_token'])){
$clientOptions['accessToken'] = $_SESSION['fs_access_token'];
}
$client = new FamilySearchClient($clientOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment