ydg / monolog-aliyun-log
Let monolog support aliyun log.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ydg/monolog-aliyun-log
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-09-22 12:48:02 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');