1. Go to this page and download the library: Download logtrace/logtrace-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
logtrace / logtrace-php example snippets
use Logtrace\Client;
use Logtrace\CreateEventRequest;
$client = new Client(getenv('LOGTRACE_API_KEY'));
$client->createEvent(new CreateEventRequest(
name: 'user.signup',
user_id: '123',
metadata: ['plan' => 'pro'],
));
$client->createSession(new CreateSessionRequest(...));
$client->createAuditLog(new CreateAuditLogRequest(...));
use Logtrace\Middleware;
$app->add(new Middleware($client));