Yii 2.0: yii2-streamlog

A Yii 2 log target for streams in URL format.
1 follower

A Yii 2 log target for streams in URL format.

This log target allows you to log to any of the URL like targets that are supported by PHP. Typical use cases are docker containers that often log to STDOUT and STDERR, in which case the target urls would be php://stdout and php://stderr respectively.

Installation and Configuration ΒΆ

Install the package through composer:

composer require codemix/yii2-streamlog

And then add this to your application configuration:

<?php
return [
    // ...
    'components' => [
        // ...
        'log' => [
            'targets' => [
                [
                    'class' => 'codemix\streamlog\Target',
                    'url' => 'php://stdout',
                    'levels' => ['info','trace'],
                    'logVars' => [],
                ],
                [
                    'class' => 'codemix\streamlog\Target',
                    'url' => 'php://stderr',
                    'levels' => ['error', 'warning'],
                    'logVars' => [],
                ],
            ],
        ],

Please report any issues you may have on Github:

https://github.com/codemix/yii2-streamlog

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet