ap-lib/logger-debug
Composer 安装命令:
composer require ap-lib/logger-debug
包简介
README 文档
README
DebugLog is a simple and configurable logging utility for PHP that writes logs both to a specified file and PHP's built-in error_log() function. It supports log levels, context printing, stack traces, and customizable message formatting.
Installation
composer require ap-lib/logger-debug
Features
- Logs messages to a file and
error_log() - Supports configurable log levels
- Optionally prints context and stack traces for debugging
- Customizable timestamp format with timezone support
- Allows message formatting through a decorator function
- Ensures logs are written in append mode to preserve history
Requirements
- PHP 8.3 or higher
Getting started
use AP\Logger\Dumper\DebugLog; Log::router()->setDefaultDumper(new DebugLog( filename: "/logs/default.log", log_level: Level::DEBUG, print_context: true, print_trace: false, timezone: "pst" ));
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-11