logger/essentials
最新稳定版本:1.0.1.1
Composer 安装命令:
composer require logger/essentials
包简介
Advanced logging component library
README 文档
README
A lightweight, composable logging toolkit for PHP that implements the PSR‑3 LoggerInterface and lets you build flexible pipelines. Combine output loggers (e.g., streams, syslog) with formatters, filters, and extenders to shape messages, enrich context, and route by severity. Includes an ExtendedLogger for hierarchical captions and execution scopes.
Quick taste
use Logger\Builder; use Logger\Formatters\TemplateFormatter; use Logger\Loggers\ResourceLogger; use Psr\Log\LoggerInterface; $logger = Builder::chain( ResourceLogger::outputToStdOut(), fn (LoggerInterface $l) => new TemplateFormatter($l) ); $logger->info('Hello world', ['id' => 42]);
Component overview
- Common — ExtendedLogger for hierarchical captions and contextual scopes.
- Formatters — Render and transform messages (Template, DateTime, Prefix, JSON, etc.).
- Filters — Pass/drop by rules (min/max/range level, callbacks, regex).
- Loggers — Output sinks: streams, syslog, callbacks, in‑memory array.
- Extenders — Side‑effect hooks and enrichment (context, stacktrace, metrics).
- Manipulators — Adjust semantics like compressing log levels.
How it differs from other logging solutions:
统计信息
- 总下载量: 57.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 5
- 推荐数: 4
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-20