PHP code example of bwisemedia / laravel-bw-logger

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

    

bwisemedia / laravel-bw-logger example snippets


return [
    'channel' => env('BW_LOG_CHANNEL', 'bwise'),

    'logstash' => [
        'enabled' => env('BW_LOGSTASH_ENABLED', true),
        'driver'  => env('BW_LOGSTASH_DRIVER', 'tcp'), // tcp|http
        'host'    => env('BW_LOGSTASH_HOST', 'localhost'),
        'port'    => env('BW_LOGSTASH_PORT', 5000),
        'path'    => env('BW_LOGSTASH_HTTP_PATH', '/'),
        'timeout' => env('BW_LOGSTASH_TIMEOUT', 2.0),
    ],

    'app' => [
        'name'    => env('APP_NAME', 'bwise-app'),
        'env'     => env('APP_ENV', 'local'),
        'version' => env('APP_VERSION', null),
    ],

    'sanitize_keys' => ['password', 'token', 'authorization', 'cookie'],
];

use BWLogger;

BWLogger::info('User logged in', ['userId' => 123]);
BWLogger::error('Payment failed', [
    'orderId' => 987,
    'reason'  => 'insufficient_funds'
]);
bash
php artisan vendor:publish --tag=bw-logger-config