gobline/logwriter-db

DB Log Writer component

v2.0.0 2015-12-03 09:20 UTC

This package is auto-updated.

Last update: 2020-03-12 09:08:32 UTC


README

Gobline\Logger\Writer\DbLogWriter writes log information to a database.

Usage

$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');

Installation

You can install the DB Log Writer component using the dependency management tool Composer. Run the require command to resolve and download the dependencies:

composer require gobline/logwriter-db