PHPackages                             yii1tech/psr-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. yii1tech/psr-log

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

yii1tech/psr-log
================

Provides support for PSR compatible logger for Yii1 application

1.0.3(2y ago)212.0k↓40.8%BSD-3-ClausePHPPHP &gt;=7.1

Since Jul 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yii1tech/psr-log)[ Packagist](https://packagist.org/packages/yii1tech/psr-log)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/yii1tech-psr-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

 [ ![](https://avatars.githubusercontent.com/u/134691944) ](https://github.com/yii1tech)

Yii1 PSR Log Extension
======================

[](#yii1-psr-log-extension)

This extension allows integration with PSR compatible logger for Yii1. Its usage in particular it allows usage of [Monolog](https://github.com/Seldaek/monolog) logger.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/bffcb5cb0191ccfdbf2f8a99f2e50c79a739ec14f0637fa494138e4dca0e5d3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79696931746563682f7073722d6c6f672e737667)](https://packagist.org/packages/yii1tech/psr-log)[![Total Downloads](https://camo.githubusercontent.com/4a4a58412d4e10ebf6821d6da26246b66dad24b30979610714bdc0e6608b42e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79696931746563682f7073722d6c6f672e737667)](https://packagist.org/packages/yii1tech/psr-log)[![Build Status](https://github.com/yii1tech/psr-log/workflows/build/badge.svg)](https://github.com/yii1tech/psr-log/actions)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yii1tech/psr-log

```

or add

```
"yii1tech/psr-log": "*"
```

to the "require" section of your composer.json.

Usage
-----

[](#usage)

This extension allows integration with PSR compatible logger for Yii1. It provides several instruments for that. Please choose the one suitable for your particular needs.

Wrap PSR logger into Yii logger
--------------------------------

[](#wrap-psr-logger-into-yii-logger-)

The most common use case for PSR logger involvement into Yii application is usage of 3rd party log library like [Monolog](https://github.com/Seldaek/monolog). This can be achieved using `\yii1tech\psr\log\Logger` instance as Yii logger. Its instance should be passed to `\Yii::setLogger()`before the application instantiation.

Application entry script example:

```
