PHPackages                             mozayedsaeid/ducklog - 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. mozayedsaeid/ducklog

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

mozayedsaeid/ducklog
====================

Logging PHP stuff

00PHP

Since Dec 15Pushed 6mo agoCompare

[ Source](https://github.com/MoZayedSaeid/ducklog)[ Packagist](https://packagist.org/packages/mozayedsaeid/ducklog)[ RSS](/packages/mozayedsaeid-ducklog/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

DuckLogger 🦆
============

[](#ducklogger-)

A simple, zero-config PHP logger that behaves like `console.log()` but writes to a file named `duck.log`.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mozayedsaeid/ducklog
```

Usage
-----

[](#usage)

Use the global `duck()` helper function to log any variable. The logger handles strings, arrays, objects, booleans, and null values automatically.

```
// Log a string
duck("Hello World");

// Log an array
duck(['user_id' => 1, 'role' => 'admin']);

// Log an object
duck($userObject);

// Log boolean or null
duck(true);
duck(null);
```

BEWARE: The log output is appended to `duck.log` in your project root.

Output Format
-------------

[](#output-format)

The log entries are formatted with a timestamp, the data type, and the content:

```
[2024-03-20 15:30:00] [string] Hello World
[2024-03-20 15:30:01] [array] Array
(
    [user_id] => 1
    [role] => admin
)

```

Features
--------

[](#features)

- 🕒 **Timestamped**: Every entry is timestamped.
- 📦 **Type Aware**: Automatically detects and labels the variable type.
- 🚀 **Zero Config**: Just install and use `duck()`.
- 🔒 **Concurrency Safe**: Uses file locking to prevent write conflicts.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance46

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://avatars.githubusercontent.com/u/43301747?v=4)[Mohammed Saeid](/maintainers/MoSaeid)[@MoSaeid](https://github.com/MoSaeid)

---

Top Contributors

[![MoZayedSaeid](https://avatars.githubusercontent.com/u/183497215?v=4)](https://github.com/MoZayedSaeid "MoZayedSaeid (3 commits)")

### Embed Badge

![Health badge](/badges/mozayedsaeid-ducklog/health.svg)

```
[![Health](https://phpackages.com/badges/mozayedsaeid-ducklog/health.svg)](https://phpackages.com/packages/mozayedsaeid-ducklog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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