PHP code example of orisai / monolog-logtail

1. Go to this page and download the library: Download orisai/monolog-logtail 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/ */

    

orisai / monolog-logtail example snippets


use Monolog\Logger;
use Orisai\MonologLogtail\LogtailClient;
use Orisai\MonologLogtail\LogtailHandler;

$logger = new Logger();
$token = '<YOUR_LOGTAIL_TOKEN>';
$logger->pushHandler(
	new LogtailHandler(
		new LogtailClient($token, /* ... */)
	),
);

$logger->info('Message logged');