weew/app-monolog

Integration of the monolog/monolog package into weew/app package.


License
MIT

Documentation

App monolog provider

Build Status Code Quality Test Coverage Version Licence

Table of contents

Installation

composer require weew/app-monolog

Introduction

This package integrates the monolog/monolog library into the weew/php-app package.

Usage

To make monolog available inside the application, simply register MonologProvider on the kernel.

$app->getKernel()->addProviders([
    MonologProvider::class
]);

You can retrieve a specific logger by the channel name:

$channelManager = $app->getContainer()->get(IMonologChannelManager::class);
$channelManager->getLogger('config_name');

Example config

This is how your configuration might look like:

monolog:
  channels:

    default:
      log_file_path: /var/logs/default.log
      log_level: debug

    error:
      log_file_path: /var/logs/error.log
      log_level: debug