2017 © Pedro Peláez
 

library slim-monolog

Write log file on your Slim 3 application with Monolog logger.

image

projek-xyz/slim-monolog

Write log file on your Slim 3 application with Monolog logger.

  • Thursday, October 13, 2016
  • by feryardiant
  • Repository
  • 1 Watchers
  • 9 Stars
  • 3,463 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 14 % Grown

The README.md

Monolog Logger Integration for Slim micro framework 3

LICENSE VERSION Build Status Coveralls Code Climate Code Climate SensioLabs Insight, (*1)

Write log file on your Slim 3 application with Monolog logger., (*2)

Install

Via Composer, (*3)

$ composer require projek-xyz/slim-monolog --prefer-dist

Requires Slim micro framework 3 and PHP 5.5.0 or newer., (*4)

Usage

// Create Slim app
$app = new \Slim\App();

// Fetch DI Container
$container = $app->getContainer();

// Register Monolog helper:
// Option 1, using MonologProvider
$container->register(new \Projek\Slim\MonologProvider);

// Option 2, using Closure
$container['logger'] = function ($c) {
    $settings = [
        // Path to log directory
        'directory' => 'path/to/logs',
        // Log file name
        'filename' => 'my-app.log',
        // Your timezone
        'timezone' => 'Asia/Jakarta',
        // Log level
        'level' => 'debug',
        // List of Monolog Handlers you wanna use
        'handlers' => [],
    ];

    return new \Projek\Slim\Monolog('slim-app', $settings);
};

// Define a log middleware
$app->add(function ($req, $res, $next) {
    $return = $next($req, $res);

    $this->logger->info('Something happen');

    return $return;
});

// Run app
$app->run();

NOTE: - If you are using option 1 please make sure you already have $container['settings']['logger'] in your configuration file. - $settings['filename'] only required if you have $settings['directory'] - Set $settings['directory'] to syslog to use System Log., (*5)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*6)

License

This library is open-sourced software licensed under MIT license., (*7)

The Versions

13/10 2016

dev-master

9999999-dev http://www.projek.xyz/slim-monolog

Write log file on your Slim 3 application with Monolog logger.

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework library monolog slim microframework

10/10 2016

v0.1.6

0.1.6.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 log helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

07/12 2015

v0.1.5

0.1.5.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 log helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

07/12 2015

v0.1.4

0.1.4.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 log helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

07/12 2015

v0.1.3

0.1.3.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 log helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

07/11 2015

v0.1.2

0.1.2.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 view helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

06/11 2015

v0.1.1

0.1.1.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 view helper built on top of the Monolog logger component

  Sources   Download

MIT

The Requires

 

The Development Requires

logger framework monolog slim

05/11 2015

v0.1.0

0.1.0.0 http://www.projek.xyz/slim-monolog

Slim Framework 3 view helper built on top of the Plates templating component

  Sources   Download

MIT

The Requires

 

The Development Requires

framework template monolog slim view