exbico/monolog-db-handler
最新稳定版本:2.1.0
Composer 安装命令:
composer require exbico/monolog-db-handler
包简介
DB handler for monolog
关键字:
README 文档
README
INSTALLATION
The preferred way to install this extension is through composer:
composer require exbico/monolog-db-handler
Basic Usage
<?php use Monolog\Level; use Monolog\Logger; use Exbico\Handler\DbHandler; use Exbico\Handler\DbHandlerConfig; use Exbico\Handler\Connection\PdoAdapter; $connection = new PdoAdapter(new PDO(dsn: 'pgsql:dbname=foo;host=127.0.0.1', username: 'root', password: null)); $logger = new Logger('example',[new DbHandler(connection: $connection)]); // You can also specify which level of messages should be logged and the table name for each level $config = new DbHandlerConfig( emergency: 'log_emergency', alert: 'log_alert', critical: 'log_critical', error: 'log_error', warning: 'log_warning', notice: 'log_notice', info: 'log_info', debug: null, // debug level will not be logged ); $logger->pushHandler(new DbHandler(connection: $connection, config: $config));
You need to create set of required tables with the following fields:
level- varcharmessage- varchar|textdatetime- datetimecontext- text|json|jsonbextra- text|json|jsonb
统计信息
- 总下载量: 285
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-09