anroots/kohana-loggly
最新稳定版本:1.0.0
Composer 安装命令:
composer require anroots/kohana-loggly
包简介
A Kohana log writer for Loggly.com
README 文档
README
Write Kohana logs to a Loggly.com input. You need an account at loggly.com for this to work. The basic account is free, with quota limits.
Installation
As a Git submodule:
git submodule add git://github.com/anroots/kohana-loggly.git modules/loggly
As a Composer dependency
{ "require": { "anroots/kohana-loggly":"1.*" } }
Activate the module in bootstrap.php.
<?php Kohana::modules(array( ... 'loggly' => MODPATH.'kohana-loggly', ));
Create a new Loggly input
Create a new input via the loggly.com control panel. The input should be a JSON-enable HTTPS input. The module sends logs to Loggly JSON-encoded; that means you can do some really cool stuff with that data.
Add the log writer after module activation
<?php Kohana::$log->attach(new Log_Loggly('my-input-key'));
You can use the $levels and $min_level params of $log->attach to set restraints on when to log to Loggly:
Kohana::$log->attach(new Log_Loggly('my-input-key'), Log::INFO); // Log only messages starting from level INFO (no DEBUG)
Log some data in your code
<?php Kohana::$log->add(Log::EMERGENCY,'The world will end on :time.',[':time'=>time()+60]);
Results appear in the Loggly console
Licence
统计信息
- 总下载量: 132
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-01-15