PHP code example of attlaz / attlaz-monolog
1. Go to this page and download the library: Download attlaz/attlaz-monolog 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/ */
attlaz / attlaz-monolog example snippets
use Monolog\Logger;
use Monolog\Level;
use Attlaz\Client;
use Attlaz\Model\Log\LogStreamId;
use Attlaz\AttlazMonolog\Handler\AttlazHandler;
$client = new Client();
$client->authWithToken('<your-token>');
// or: $client->authWithClient('<client-id>', '<client-secret>');
$handler = new AttlazHandler($client, new LogStreamId('Vt9HtWRee'), Level::Info);
$logger = new Logger('my-channel');
$logger->pushHandler($handler);
// Add records to the log
$logger->warning('Foo');
$logger->error('Bar');