consultnn/yii2-stream-target

Yii2 log target for php stream wrappers, like php://stdout

1.0 2016-02-10 07:50 UTC

This package is not auto-updated.

Last update: 2024-12-17 05:12:44 UTC


README

StreamTarget sends log messages to the php stream wrappers.

Converts an arrays and objects to strings using Json::encode().

Example config:

    [
        'targets' => [
            [
                'class'   => 'consultnn\streamTarget\StreamTarget',
                'levels'  => ['error', 'warning'],
                'stream' => 'php://stderr',
                'except' => ['yii\web\HttpException:404']
            ],
            [
                'class'   => 'consultnn\streamTarget\StreamTarget',
                'levels'  => ['info'],
                'stream' => 'php://stdout',
            ]
        ]
    ]