PHPackages                             herrera-io/pdo-log - 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. herrera-io/pdo-log

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

herrera-io/pdo-log
==================

A simple way to log PDO queries and execution times.

1.0.0(12y ago)9180.8k—3.2%[1 PRs](https://github.com/kherge-archive/php-pdo-log/pulls)1MITPHPPHP &gt;=5.3.3

Since Aug 23Pushed 12y agoCompare

[ Source](https://github.com/kherge-archive/php-pdo-log)[ Packagist](https://packagist.org/packages/herrera-io/pdo-log)[ Docs](http://github.com/herrera-io/php-pdo-log)[ RSS](/packages/herrera-io-pdo-log/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (2)Used By (1)

PDO Log
=======

[](#pdo-log)

[![Build Status](https://camo.githubusercontent.com/98a0ae3ef638ac11e55f24aec59345ffaeee6aff3f02d7aab488590a8a8e9158/68747470733a2f2f7472617669732d63692e6f72672f686572726572612d696f2f7068702d70646f2d6c6f672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/herrera-io/php-pdo-log)

This library provides an alternative class to `PDO`. Its purpose is to log queries and their execution times. You can also set an observer that will be called whenever a new log entry is added.

```
$pdo = new Herrera\Pdo\Pdo('sqlite::memory');

$pdo->onLog(
    function (array $entry) {
        print_r($entry);
    }
);

$pdo->exec('CREATE TABLE test ()');

/*
Array
(
    [query] => CREATE TABLE test ()
    [time] => 0.00026607513427734
    [values] => Array
        (
        )
)
*/

// retrieves all logged queries
$entries = $pdo->getLog();
```

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

[](#installation)

Use Composer:

```
$ composer require "herrera-io/pdo-log=~1.0"

```

Usage
-----

[](#usage)

The logging `Pdo` class is a subclass of the real `PDO` class, so the only thing that has been changed is adding the ability to log certain actions, and that `query()` and `prepare()` will return the logging version of the `PDOStatement` class. This version of the class is not a subclass of the original, but all property gets/sets and method calls are mirrored. You can still retrieve the real instance using `PdoStatement->getPdoStatement()`.

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4595d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

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

---

Tags

logdebugpdo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/herrera-io-pdo-log/health.svg)

```
[![Health](https://phpackages.com/badges/herrera-io-pdo-log/health.svg)](https://phpackages.com/packages/herrera-io-pdo-log)
```

###  Alternatives

[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M21](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183610.5k3](/packages/inpsyde-wonolog)[baibaratsky/yii2-rollbar

Rollbar for Yii2

35129.7k](/packages/baibaratsky-yii2-rollbar)[snapshotpl/zf-snap-php-debug-bar

PHP Debug Bar module for Zend Framework 2

3026.1k](/packages/snapshotpl-zf-snap-php-debug-bar)

PHPackages © 2026

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