weew/app-monolog

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

Installs: 118

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/weew/app-monolog

v1.12.0 2016-12-20 15:49 UTC

README

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