Simple but powerful HTTP access logger and usage monitoring. Mostly it will help to monitor API usage and anytime you can add your database storage to save all the usages.
Currently Google DataStore has been added as a Storage Provider. Everybody welcome to add more provider to it.
Install with composer require previewtechs/http-access-logger
<?php
require "vendor/autoload.php";
//Setup your Google Datastore Gateway
$gateway = new \GDS\Gateway\RESTv1('my-google-cloud-project-name');
$dataStore = new \GDS\Store('my-kind-name', $gateway);
//Initialize storage provider
$storage = new \Previewtechs\HTTP\AccessLogger\Providers\GoogleDataStore($dataStore);
/**
* Now start recording your HTTP access log by providign your storage provider and Psr/http-message ServerRequestInterface
* compatible $request object
*/
$log = new \Previewtechs\HTTP\AccessLogger\AccessLog($request, $storage);
$log->record();
For bug and issues please open an issue.
Keep it simple but we can add more and more Storage provider like (MySQL, MongoDB and other storage);
To build a new provider please see src/Providers/GoogleDataStore.php