neam / yii-streamlog
将 Yii 1 的日志发送到 stdout/stderr - 用于与 http://github.com/neam/docker-stack 上可用的 php-fpm/nginx Docker 栈一起使用
1.0.1
2015-03-11 23:46 UTC
This package is not auto-updated.
Last update: 2024-09-14 16:34:42 UTC
README
将 Yii 1 的日志发送到 stdout/stderr - 用于与 http://github.com/neam/yii-streamlog/blob/HEAD/ 上可用的 php-fpm/nginx Docker 栈一起使用
感谢 Haensel 在 此论坛帖子 中提供的帮助!
安装
通过 composer 安装
composer require neam/yii-streamlog:*
或下载扩展,将 src
文件夹复制到您的项目,并确保在应用程序初始化的某个阶段引入文件 LogRoute.php
。
使用方法
将所有现有的使用 CFileLogRoute 的路由改为使用 \neam\yii_streamlog\LogRoute
'components' => array(
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => '\neam\yii_streamlog\LogRoute',
'levels' => 'error, warning',
),
),
),
),
另外,确保在您的 php-fpm 池配置中设置 catch_worker_output=yes
。