upnid / logentries-bundle
将 Symfony 日志推送到 Logentries。
这个包的官方仓库似乎已不存在,因此该包已被冻结。
0.1.2
2016-02-12 04:12 UTC
Requires
- logentries/logentries-monolog-handler: ^2.0
- symfony/symfony: >=2.4.0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2019-11-28 20:00:04 UTC
README
将 Symfony 日志推送到 Logentries。
说明
1 - 安装库
composer require upnid/logentries-bundle
2 - 添加包
<?php # app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Upnid\Bundle\LogentriesBundle\LogentriesBundle(), ); // ... } // ... }
3 - 配置包
# app/config/config.yml logentries: token: YOUR_PROJECT_TOKEN_HERE
4 - 并添加处理器
# app/config/config.yml monolog: handlers: logentries: type: service id: logentries.monolog.handler
完成。这就足够了。
生产配置
如果您正在使用 Logentries 进行生产,您可能想只记录相关的事情,比如异常、错误等。为此,您可以使用一些 神奇的 配置。
而不是使用第四步中显示的配置,请使用以下配置
# app/config/config.yml monolog: handlers: fc_logentries: type: fingers_crossed action_level: error handler: logentries logentries: type: service id: logentries.monolog.handler level: debug
@TODO
- 编写测试。
许可证
MIT. 查看此处.