Drivers

The Logger Driver

Introduction

The Logger driver is based on Monolog exposes Monolog Logger object application events and errors in your API.

Installation

Install the driver via composer by running:

composer require kipchak/driver-logger

Initialise the Driver

Add the following line to your drivers/drivers.php file:

\Mamluk\Kipchak\Driver\Logger\Logger::iniitalise($container);

Configuration

This driver has no configuration.

Usage

use Kipchak\Driver\Logger\Logger;

$logger = Logger::get();
$logger->debug('Debug message');
$logger->info('Info message');
$logger->warning('Warning message');
$logger->error('Error message', ['context' => 'data']);

Log level is automatically set based on the debug setting in the kipchak.api.php config file.

Git Repository

The source code for this driver is available on 1x.ax at https://1x.ax/mamluk/kipchak/drivers/logger.

Previous
Config
Next
HTTP