twistersfury/monolog-helpers

Adds Some Common Utility Helpers To Monolog

v1.0.5 2018-04-02 21:15 UTC

This package is not auto-updated.

Last update: 2024-04-28 21:15:37 UTC


README

This repo contains various helpers for use with monolog. For use with PHP 7.0 and Monolog 2.0.

Build Status

Processors

GlobalsProcessor

Creates a new record entry of 'php_globals'. This record will include all (or specified) $_ global variables in the current execution. Useful for debugging.

All Globals

use TwistersFury\Monolog\Processors\GlobalsProcessor;
$processor = new GlobalsProcessor();

Specified Globals

use TwistersFury\Monolog\Processors\GlobalsProcessor;
$processor = new GlobalsProcessor(
    [
        'post'    => true,
        'get'     => false,
        'request' => false,
        'server'  => true
    ]
);

BacktraceProcessor

Creates a new record entry of 'trace'. This record will include the stack trace. It will automatically exclude the most recent entries to ensure you don't get additional useless stack information. This exclusion is controllable on the construct.

Without Skip

use TwistersFury\Monolog\Processors\BacktraceProcessor;

$processor = new BacktraceProcessor();

With Skip

use TwistersFury\Monolog\Processors\BacktraceProcessor;

//The five most recent stacks will be ignored.
$processor = new BacktraceProcessor(5);