bayfrontmedia/monolog-pdo 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bayfrontmedia/monolog-pdo

最新稳定版本:v1.1.0

Composer 安装命令:

composer require bayfrontmedia/monolog-pdo

包简介

Monolog handler used to write log files to a MySQL database.

README 文档

README

Monolog handler used to write log files to a MySQL database.

License

This project is open source and available under the MIT License.

Author

Bayfront Media

Requirements

  • PHP >= 8.0 (Tested up to 8.4)
  • PDO PHP extension

Installation

composer require bayfrontmedia/monolog-pdo

Usage

Before pushing this handler to a Logger instance, you must first create the necessary database table to store the records.

The table can be created using the up method, and removed using the down method.

The constructor requires a PDO instance, and the table name you wish to use:

use Bayfront\MonologPDO\PDOHandler;

/** @var PDO $pdo */
$handler = new PDOHandler($pdo, 'table_name');

$handler->up();

Once the table has been created, the handler can be pushed to a Logger instance:

use Bayfront\MonologPDO\PDOHandler;
use Monolog\Logger;

$log = new Logger('channel_name');

/** @var PDO $pdo */
$handler = new PDOHandler($pdo, 'table_name');

$log->pushHandler($handler);

From here, your log records should appear in the MySQL table.

统计信息

  • 总下载量: 655
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-18