PHP code example of oanhnn / laravel-logzio

1. Go to this page and download the library: Download oanhnn/laravel-logzio 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/ */

    

oanhnn / laravel-logzio example snippets




use Laravel\Logzio\Log\Handler;
use Monolog\Logger;

$config = [
    'token' => '...',
    'type' => 'http-bulk',
    'ssl' => true,
    'region' => '',
];

$logger = new Logger('log-name');
$logger->pushHandler(new Handler(Logger::DEBUG, true, $config);

$logger->info('Some message');


return [
    // ...
	'custom' => [
	    'driver'           => 'logzio',
	    'name'             => 'channel-name',
	    'token'            => 'logz-access-token',
	    'type'             => 'http-bulk',
	    'ssl'              => true,
	    'level'            => 'info',
	    'bubble'           => true,
	    'region'           => 'eu', // leave empty for default region
	    'timestamp_format' => '', // leave empty for default format (

Log::channel('custom')->info('Some message');