jantia / logit
Jantia 对 PSR-3 日志接口的实现
dev-dev
2024-09-20 14:36 UTC
Requires
- php: ^8.3.0
- ext-mbstring: *
- ext-openssl: *
- jantia/plugin-message: @dev|^3.0.0
- jantia/plugin-monitor: @dev|^3.0.0
- jantia/stdlib: @dev|^3.0.0
- laminas/laminas-uri: ^2.12.0
- psr/log: ^3.0.2
- tiat/fluentd: ^3.0.0
- tiat/standard: ^3.0.0
- tiat/stdlib: ^3.1.0
Requires (Dev)
- phpunit/phpunit: ^11.3.6
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-09-20 11:37:25 UTC
README
Logit 处理你的日志到文件、数据库和各种数据湖。以下为处理器的完整列表。您可以使用以下信息构建自己的特殊处理器,以实现高级日志策略。
此库实现了 PSR-3 接口,您可以在自己的库中对它进行类型检查,以保持最大程度的互操作性。您还可以在您的应用程序中使用它,以确保您可以在以后的时间使用另一个兼容的记录器。
安装
使用以下命令安装最新版本
$ composer require jantia/logit
基本用法
<?php
use Jantia\LogitLevel;
use Jantia\Logger;
use Jantia\Handler\FileHandler;
// create a log channel
$log = new Logger('name');
$log->pushHandler(new Handler('path/to/your.log', LogitLevel::Warning->value));
// add records to the log
$log->warning('My warning');
$log->error('My error');
文档
关于
要求
- Logit
^3.0与 PHP 8.3 或更高版本兼容。
作者
Jan Theon - jan@jantheon.com
许可
Logit 使用 BSD 3-Clause 许可证 - 详细信息请参阅 LICENSE 文件。