alleyinteractive/logger
Composer 安装命令:
composer require alleyinteractive/logger
包简介
A Monolog-based logging tool for WordPress. Supports storing log message in a custom post type or in individual posts and terms.
README 文档
README
Providing a WordPress integration with Monolog, allowing site-wide and post and term specific logging.
Documentation
See the wiki for complete information and more examples.
Installation
Logger requires PHP 8.2 and Composer to run properly.
composer require alleyinteractive/logger
You can also install the plugin as a submodule by using the *-built tag of a
release.
Usage
AI Logger is a complete interface to Monolog with some nice WordPress handlers built in.
// Log site-wide to the ai_log post type. ai_logger()->info( 'Log message...' ); \AI_Logger\AI_Logger::info( 'Another format for logging.' );
Logging to a Specific Post
Logs will be appended to a post's meta for review.
ai_logger_to_post( $post_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific post.' );
Logging to a Specific Term
Logs will be appended to a term's meta for review.
ai_logger_to_term( $term_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific term.' );
Logging to Query Monitor
ai_logger_to_qm()->info( 'This will show up in Query Monitor!' );
Logging with Default Context
ai_logger()->with_context( 'example-context' )->info( 'This will log to the example-context.' );
Also supports an array of default log context:
ai_logger()->with_context( [ 'context' => 'example-context', 'key' => 'value', ] )->info( 'This will log to the example-context with key=>value.' );
You can also pass the context to ai_logger() directly:
ai_logger( 'example-context' )->info( 'This will log to the example-context.' );
Changelog
Please see CHANGELOG for more information on what has changed recently.
Maintainers
This project is actively maintained by Alley Interactive. Like what you see? Come work with us.
License
This software is released under the terms of the GNU General Public License version 2 or any later version.
alleyinteractive/logger 适用场景与选型建议
alleyinteractive/logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 376.05k 次下载、GitHub Stars 达 30, 最近一次更新时间为 2020 年 05 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alleyinteractive/logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alleyinteractive/logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 376.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 33
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2020-05-15
