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 4mo agoCompare

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

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

17

—

LowBetter than 6% of packages

Maintenance50

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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/9c4647bf3b6187a24cdc1722fc6983ef2b8cd031ac217b542bf37ca0b2aeac81?d=identicon)[MoSaeid](/maintainers/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.2B9.2k](/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.2M138](/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)
