ap-lib/logger-debug 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ap-lib/logger-debug

Composer 安装命令:

composer require ap-lib/logger-debug

包简介

README 文档

README

MIT License

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-11