bloom-ux/wpdb-monolog
Composer 安装命令:
composer require bloom-ux/wpdb-monolog
包简介
Integrate monolog logging with $wpdb
README 文档
README
Use monolog with WordPress and log errors to your database.
Installation
Install using composer: composer require bloom-ux/wpdb-monolog:dev-main.
It will install as a mu-plugin.
If you're using composer's autoloader, you're done.
Components
\bloom\WPDB_Monolog\WPDB_Handler→ monolog handler that writes logs to your WordPress database.\bloom\WPDB_Monolog\WP_CLI_Handler→ monolog handler that writes logs to WordPress command line interface.\bloom\WPDB_Monolog\WP_Processor→ monolog processor that adds "extra" data to a monolog record.
Usage
Basic
There are some helper functions to ease the integration:
<?php use function bloom\WPDB_Monolog\get_logger_for_channel; use function bloom\WPDB_Monolog\set_channel_level; $logger = get_logger_for_channel( 'MyCustomChannel' ); set_channel_level( $logger, 'production' === wp_get_environment_type() ? 400 : 100 ); $logger->info("Lorem ipsum dolor sit amet", array( 'foo' => 'bar' ) );
Custom
You can integrate the handler and/or processor as you see fit with your monolog integration.
统计信息
- 总下载量: 92
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2024-02-21