PHP code example of tsfcorp / graylog

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

    

tsfcorp / graylog example snippets


composer 

'providers' => [
    // ...
    TsfCorp\Graylog\GraylogServiceProvider::class,
];

php artisan graylog:install

use TsfCorp\Graylog\GraylogMessage;

$message = (new GraylogMessage)
    ->setLevel(GraylogMessage::ERROR)
    ->setShortMessage('Short message.')
    ->setFullMessage('Full message.')
    ->setSubsystem('subsystem')
    ->setAdditional('custom_1', 'value_1')
    ->setAdditional('custom_2', 'value_2')
    ->setContext([
        'prop' => 'value'
    ]);

$message->enqueue();

$message->enqueue()->dispatch();