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:
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.