PHP code example of suver / laravel-gelf-logger

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

    

suver / laravel-gelf-logger example snippets


suver\LaravelGelfLogger\LaravelGelfLoggerServiceProvider::class

'GelfLogger' => \suver\LaravelGelfLogger\Facades\GelfLogger::class

/**
 * The ip address of the log server. If the value below is null,
 * the default value '127.0.0.1' will be used.
 */
'host' => null,

/**
 * The udp port of the log server. If the value below is null,
 * the default value 12201 will be used.
 */
'port' => null

gelf()->alert('There was a foo in bar', ['foo' => 'bar']);

try {
    throw new \Exception('test exception');
} catch (\Exception $e) {
    gelf()->emergency('Exception example', [
        'exception' => $e
    ]);
}
sh
php artisan vendor:publish --provider="suver\LaravelGelfLogger\LaravelGelfLoggerServiceProvider"