Skip to content

gluephp/glue-monolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monolog for Glue

Use Monolog with gluephp/glue

Installation

Use Composer:

$ composer require gluephp/glue-monolog

Configure Monolog

$app = new Glue\App;

$app->config->override([
    'monolog' => [
        'folder'    => '/absolute/path/to/log/folder',
        'file'      => 'log_' . date('Ymd') . '.log',
        'level'     => 'error' // PSR-3 logging level
    ],
]);

Register Monolog

$app->register(
    new Glue\Monolog\ServiceProvider()
);

Get the Monolog instance

Once the service provider is registered, you can fetch the Monolog instance with:

$monolog = $app->make('Monolog\Logger');

or since Monolog implements the PSR interface:

$monolog = $app->make('Psr\Log\LoggerInterface');

or use the alias:

$monolog = $app->log;

About

Monolog adapter for gluephp/glue

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages