2017 © Pedro Peláez
 

library enlite-monolog

Monolog integration to Zend Framework v2 and v3

image

enlitepro/enlite-monolog

Monolog integration to Zend Framework v2 and v3

  • Sunday, March 11, 2018
  • by ftdebugger
  • Repository
  • 3 Watchers
  • 15 Stars
  • 139,359 Installations
  • PHP
  • 4 Dependents
  • 1 Suggesters
  • 14 Forks
  • 8 Open issues
  • 22 Versions
  • 7 % Grown

The README.md

Monolog integration to Laminas Build Status Code Coverage Scrutinizer Code Quality

Integration to Laminas with great logging system monolog, (*1)

INSTALL

The recommended way to install is through composer from command line., (*2)

composer require enlitepro/enlite-monolog

USAGE

  1. Add EnliteMonolog to your config/application.config.php to enable module.
// usage over service locator
$serviceLocator->get('EnliteMonologService')->debug('hello world');

use EnliteMonolog\Service\MonologServiceAwareInterface,
    EnliteMonolog\Service\MonologServiceAwareTrait;

// usage in your services
class MyService implements MonologServiceAwareInterface
{
    use MonologServiceAwareTrait;

    public function whatever()
    {
        $this->getMonologService()->debug('hello world');
    }
}

  1. Copy the config file config/monolog.global.php.dist from the module to config/autoload your project.

By default it write logs to data/logs/application.log. If you want change this behaviour, add your config following:, (*3)

    'EnliteMonolog' => array(
        'EnliteMonologService' => array(
            // Logger name
            // 'name' => 'EnliteMonolog',

            // Handlers, it can be service locator alias(string) or config(array)
            'handlers' => array(
                // by config
                'default' => array(
                    'name' => 'Monolog\Handler\StreamHandler',
                    'args' => array(
                        'stream' => 'data/log/application.log',
                        'level' => \Monolog\Logger::DEBUG,
                        'bubble' => true
                    ),
                    'formatter' => array(
                        'name' => 'Monolog\Formatter\LogstashFormatter',
                        'args' => array(
                            'applicationName' => 'My Application',
                        ),
                    ),
                ),

                // by service locator
                'MyMonologHandler'
            )
        ),

        // you can specify another logger
        // for example ChromePHPHandler

        'MyChromeLogger' => array(
            'name' => 'MyName',
            'handlers' => array(
                array(
                    'name' => 'Monolog\Handler\ChromePHPHandler',
                )
            )
        )
    ),

now you can use it, (*4)

$serviceLocator->get('EnliteMonologService')->debug('hello world');
$serviceLocator->get('MyChromeLogger')->debug('hello world');

Contributing

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request., (*5)

The Versions

19/05 2017

v2.3.0

2.3.0.0

Monolog integration to Zend Framework v2 and v3

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

31/10 2016

v2.2.0

2.2.0.0

Monolog integration to Zend Framework v2 and v3

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

23/03 2016

v2.1.1

2.1.1.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

04/05 2015

v2.1.0

2.1.0.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

28/02 2014

v2.0.0

2.0.0.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

23/01 2014

v1.2.1

1.2.1.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

23/01 2014

v1.2.0

1.2.0.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

05/12 2013

v1.1.1

1.1.1.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

22/10 2013

dev-develop

dev-develop

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

22/10 2013

v1.1.0

1.1.0.0

Monolog integration to Zend Framework 2

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

21/10 2013

v1.0.3

1.0.3.0

Monolog integration to Zend Framework 2

  Sources   Download

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

19/10 2013

v1.0.2

1.0.2.0

Monolog integration to Zend Framework 2

  Sources   Download

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

19/10 2013

v1.0.1

1.0.1.0

Monolog integration to Zend Framework 2

  Sources   Download

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2

19/10 2013

v1.0.0

1.0.0.0

Monolog integration to Zend Framework 2

  Sources   Download

The Requires

 

The Development Requires

by Evgeny Shpilevsky

monolog zend framework 2