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-05-07 02:02:36 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',
            ]
        ]
    ]