huhushow / monolog-azuretable
Monolog 的处理器,将消息发送到 Azure Table Storage
1.0.2
2016-06-20 05:53 UTC
Requires
- microsoft/windowsazure: 0.4.*
- monolog/monolog: >1.14.0
- pear-pear.php.net/http_request2: *
- pear-pear.php.net/mail_mime: *
- pear-pear.php.net/mail_mimedecode: *
Requires (Dev)
- phpunit/phpunit: 5.*
This package is not auto-updated.
Last update: 2024-09-18 18:51:03 UTC
README
Azure Table Storage 处理器,允许将日志消息存储在 Azure Table Storage 中。
安装
monolog-azuretable 通过 composer 提供。只需在 composer.json 的所需部分添加以下行,然后执行 php composer.phar update
。
"huhushow/monolog-azuretable": ">1.0.0"
使用
就像使用其他任何 Monolog 处理器一样使用它,将其推送到 Monolog Logger 实例的堆栈中。但是,处理程序需要一些参数
- $client Azure 存储账户的 TableRestProxy 实例。
- $table 应存储日志的表名
- $level 可以是 Monolog 标准日志级别的任何一种。使用 Monolog 静态定义的上下文。默认为 Logger::DEBUG
- $bubble 默认为 true
示例
假设 $client 是您的 TableRestProxy 实例,您可以使用该类如下
//Import class use AzureTableStorageHandler\AzureTableStorageHandler; //Create AzureTableStorageHandler $AzureTableStorageHandler = new AzureTableStorageHandler($client, "log", \Monolog\Logger::DEBUG); //Create logger $logger = new \Monolog\Logger($context); $logger->pushHandler($AzureTableStorageHandler); //Now you can use the logger, and further attach additional information
许可证
此工具是免费软件,并按照 MIT 许可证分发。请查看 LICENSE 文件以获取更多信息。