PHP code example of gobline / logwriter-db

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

    

gobline / logwriter-db example snippets


$metadata = new Gobline\Logger\Writer\TableMetadata('logs');
$metadata
    ->setColumnLevel('level')
    ->setColumnMessage('message')
    ->setColumnExceptionCode('exception_code')
    ->setColumnExceptionStackTrace('exception_stack_trace');

$writer = new Gobline\Logger\Writer\DbLogWriter($pdo, $metadata);

$writer->info('hello world');