ydg / monolog-aliyun-log
Let monolog support aliyun log.
v1.0.1
2023-03-22 07:22 UTC
Requires
- php: >=7.2
- alibabacloud/aliyun-log-php-sdk: ^0.6.3
- monolog/monolog: ^1.24 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.12
- phpunit/phpunit: ^9.5
- vlucas/phpdotenv: ^5.0
This package is auto-updated.
Last update: 2025-02-22 11:24:34 UTC
README
Installation
Install the latest version with
$ composer require ydg/monolog-aliyun-log
Basic Usage
<?php use Monolog\Logger; use Hdk\MonologAliyunLog\AliyunLogHelper; $config = [ 'endpoint' => 'your endpoint', 'accessKeyId' => 'your accessKeyId', 'accessKey' => 'your accessKey', 'project' => 'your project', 'logstore' => 'your logstore', ]; $log = new Logger('name'); $log->pushHandler(AliyunLogHelper::getLogHandler(AliyunLogHelper::getLogClient($config), $config)); // add records to the log $log->warning('Foo'); $log->error('Bar');