PHP code example of ebethus / laravel-mysql-log-driver

1. Go to this page and download the library: Download ebethus/laravel-mysql-log-driver 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/ */

    

ebethus / laravel-mysql-log-driver example snippets



    // [...]

    'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['mysql'],
        ],

        // [...]

        'mysql' => [
            'driver' => 'custom',
            'via' => ITelmenko\Logger\Laravel\Logging\MySQLLogger::class,
            'connection' => env('DB_LOG_CONNECTION'),
            'table' => env('DB_LOG_TABLE'),
            'name' => 'my.channel' // optional
        ],
    ],

Log::channel('mysql')->info('Something happened!');