2017 © Pedro Peláez
 

yii2-extension yii2-psr3-component

Allows you to use the Yii2 logger with libraries that are expecting a PSR-3 compatible logger

image

aotd/yii2-psr3-component

Allows you to use the Yii2 logger with libraries that are expecting a PSR-3 compatible logger

  • Tuesday, October 3, 2017
  • by aotd
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,593 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Yii2 PSR3 Logging Adapter

Simple adapter class that allow third party components use fully PSR-3 compatible adapter., (*1)

Note that Yii2 has a limited number of logging levels so this class will attempt to use the closest Yii2 equivalent for the provided PSR3 level., (*2)

Installation

composer require aotd/yii2-psr3-component dev-master

Usage

  'components' => array(
     'psr3log' => array(
         'class' => 'aotd\\PSR3LogAdapter\\Logger',
     ),
  ),

and use it somewhere in your code:, (*3)

$foo = newSomeClassThatNeedsPsr3(Yii::$app->psr3log);

Optionally you can remap log levels between PSR-3 and Yii:, (*4)

  'components' => [
     'psr3log' => [
         'class' => 'aotd\\PSR3LogAdapter\\Logger',
         'logLevelMap' => [
             'emergency' => YiiLogger::LEVEL_ERROR,
             'alert' => YiiLogger::LEVEL_ERROR,
             'critical' => YiiLogger::LEVEL_ERROR,
             'error' => YiiLogger::LEVEL_ERROR,
             'warning' => YiiLogger::LEVEL_WARNING,
             'notice' => YiiLogger::LEVEL_INFO,
             'info' => YiiLogger::LEVEL_INFO,
             'debug' => YiiLogger::LEVEL_TRACE,
         ],
     ],
  ],

The Versions

03/10 2017

dev-master

9999999-dev https://github.com/aotd1/yii2-psr3-component

Allows you to use the Yii2 logger with libraries that are expecting a PSR-3 compatible logger

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

logger log psr-3 yii2

03/10 2017

1.1

1.1.0.0 https://github.com/aotd1/yii2-psr3-component

Allows you to use the Yii2 logger with libraries that are expecting a PSR-3 compatible logger

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

logger log psr-3 yii2

31/08 2015

1.0

1.0.0.0 https://github.com/aotd1/yii2-psr3-component

Allows you to use the Yii2 logger with libraries that are expecting a PSR-3 compatible logger

  Sources   Download

The Requires

  • php >=5.4.0

 

The Development Requires

logger log psr-3 yii2