raketman/monolog-injection-bundle

Easy monolog injection into your classes

1.0.4 2020-12-06 11:33 UTC

This package is auto-updated.

Last update: 2024-05-06 19:30:48 UTC


README

Very easy Monolog Injector into your class

Usage

Download and include the Bundle class in your code, or install it via Composer.

Configration example :

monolog_injection:
  directories:
    - 'path_to_observe_files'

Usage example :

/**
 * @RaketmanLogger("validation")
 */
class ValidationV1 extends BaseType
{
    use RaketmanLoggerTrait;

Now you have property logger that contains monolog logger with channel "validation" (if exists)

 $this->logger->debug("validate-some-form", ["error" => "some-error"]);

Where to use

This is usefull for debug class without service definition, like FormBuilder, Entity and etc.