Skip to content

stuzzo/monolog-extender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monolog Extender - Extends Monolog handlers and processors

Total Downloads Latest Stable Version

Monolog sends your logs to files, sockets, inboxes, databases and various web services. See the complete reference

This library extends Monolog's handlers and processors adding data to the record generated from processors. Furthermore the library improves logs format.

Installation

Install the latest version with

$ composer require stuzzo/monolog-extender

Basic Usage

<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

// create a log channel
$log = new Logger('request');

$handler = new StreamHandler('path/to/your.log', Logger::WARNING);

$formatter = new \Stuzzo\Monolog\Formatter\StreamFormatter(null, 'Y-m-d H:i:s');
$handler->setFormatter($formatter);
$log->pushHandler($handler);

try {
    throw new \RuntimeException('Something happen');
} catch (\Exception $exception) {
    $log->critical('Error', ['exception' => $exception]);
}

Documentation

About

Requirements

  • This library works with PHP 5.5.9 or above.

Author

Alfredo Aiello - stuzzo@gmail.com - http://twitter.com/stuzzo

About

Extends Monolog formatters and processors

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages