PHP code example of ubatgroup / graylog

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

    

ubatgroup / graylog example snippets


Ubatgroup\Graylog\GraylogServiceProvider::class

'Graylog' => Ubatgroup\Graylog\Facades\Graylog::class

 Graylog::emergency( $message, array $context = array() );
 Graylog::alert( $message, array $context = array() );
 Graylog::critical( $message, array $context = array() );
 Graylog::error( $message, array $context = array() );
 Graylog::warning( $message, array $context = array() );
 Graylog::notice( $message, array $context = array() );
 Graylog::info( $message, array $context = array() );
 Graylog::debug( $message, array $context = array() );

Graylog::alert('There was a foo in bar', [
    'foo' => 'bar',
    'other_context_key' => 'other_context_value',
]);

try {
    throw new \Exception('Nice exception !');
} catch (\Exception $e) {
    Graylog::emergency('Exception handled !', [
        'exception' => $e,
        'additionnal_data' => 'Hello world!
    ]);
}
sh
composer dump-autoload
sh
php artisan vendor:publish --provider="Ubatgroup\Graylog\GraylogServiceProvider"