PHPackages                             ap-lib/logger-debug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. ap-lib/logger-debug

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

ap-lib/logger-debug
===================

024PHP

Since Mar 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ap-lib/logger-debug)[ Packagist](https://packagist.org/packages/ap-lib/logger-debug)[ RSS](/packages/ap-lib-logger-debug/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AP\\Logger
==========

[](#aplogger)

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](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
------------

[](#installation)

```
composer require ap-lib/logger-debug
```

Features
--------

[](#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
------------

[](#requirements)

- PHP 8.3 or higher

Getting started
---------------

[](#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"
));
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1215fe5ecc9ba0ab1c730d3c992125cf6ebf460562e66be71ebae127789d465a?d=identicon)[AntonPanfilov](/maintainers/AntonPanfilov)

---

Top Contributors

[![anton-panfilov](https://avatars.githubusercontent.com/u/1083546?v=4)](https://github.com/anton-panfilov "anton-panfilov (12 commits)")

### Embed Badge

![Health badge](/badges/ap-lib-logger-debug/health.svg)

```
[![Health](https://phpackages.com/badges/ap-lib-logger-debug/health.svg)](https://phpackages.com/packages/ap-lib-logger-debug)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
