Skip to content
Nav

Logging

composer require langsys/langsys-php
Packagist version Monthly downloads License PHP 7.4+

Optional file-based logging in JSON Lines format. Disabled by default; enabled when a writable log_path is set.

$client = new Client('key', 'project', [
'log_path' => '/var/log/langsys.log',
'log_level' => 'debug', // debug, info, warning, error
]);

What gets logged: API requests (method, URL, status, duration), cache hits/misses, authorization, and registration flush. Each entry is one JSON object per line.

$viewer = $client->getLogViewer();
$entries = $viewer->getEntries('warning');
$stats = $viewer->getStats();
$html = $viewer->render('info');
$client->displayLogs();
$viewer->clear();
Feedback