PHP code example of cre8-it / log-relay

1. Go to this page and download the library: Download cre8-it/log-relay 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/ */

    

cre8-it / log-relay example snippets


use LogRelay\LogRelay\HttpHandler;

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'http'],
    ],

    'http' => [
        'driver' => 'monolog',
        'handler' => HttpHandler::class,
        'level' => env('LOG_LEVEL', 'debug'),
        'handler_with' => [
            'url' => env('LOG_RELAY_URL', ''),
            'token' => env('LOG_RELAY_TOKEN', ''),
            'app' => env('LOG_RELAY_APP', ''),
            'async' => true,
        ],
    ],
],

use Illuminate\Support\Facades\Log;

Log::error('Payment failed', ['order' => 42]);
Log::channel('http')->info('Invoice created');

'async' => false,