PHPackages                             bayfrontmedia/monolog-pdo - 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. [Database &amp; ORM](/categories/database)
4. /
5. bayfrontmedia/monolog-pdo

ActiveLibrary[Database &amp; ORM](/categories/database)

bayfrontmedia/monolog-pdo
=========================

Monolog handler used to write log files to a MySQL database.

v1.1.0(1y ago)3805↑76.5%2MITPHPPHP &gt;=8.0

Since Aug 18Pushed 1y agoCompare

[ Source](https://github.com/bayfrontmedia/monolog-pdo)[ Packagist](https://packagist.org/packages/bayfrontmedia/monolog-pdo)[ Docs](https://github.com/bayfrontmedia/monolog-pdo)[ RSS](/packages/bayfrontmedia-monolog-pdo/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Monolog PDO
-----------

[](#monolog-pdo)

[Monolog](https://github.com/Seldaek/monolog) handler used to write log files to a MySQL database.

- [License](#license)
- [Author](#author)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)

License
-------

[](#license)

This project is open source and available under the [MIT License](LICENSE).

Author
------

[](#author)

[![Bayfront Media](https://camo.githubusercontent.com/0c0163913b2092e97dbf9684970adaf86f2f25871298d3d28b2dff4bf75b2915/68747470733a2f2f63646e312e6f6e62617966726f6e742e636f6d2f62666d2f6272616e642f62666d2d6c6f676f2e737667)](https://camo.githubusercontent.com/0c0163913b2092e97dbf9684970adaf86f2f25871298d3d28b2dff4bf75b2915/68747470733a2f2f63646e312e6f6e62617966726f6e742e636f6d2f62666d2f6272616e642f62666d2d6c6f676f2e737667)

- [Bayfront Media homepage](https://www.bayfrontmedia.com?utm_source=github&utm_medium=direct)
- [Bayfront Media GitHub](https://github.com/bayfrontmedia)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0 (Tested up to `8.4`)
- `PDO` PHP extension

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

[](#installation)

```
composer require bayfrontmedia/monolog-pdo

```

Usage
-----

[](#usage)

Before pushing this handler to a `Logger` instance, you must first create the necessary database table to store the records.

The table can be created using the `up` method, and removed using the `down` method.

The constructor requires a `PDO` instance, and the table name you wish to use:

```
use Bayfront\MonologPDO\PDOHandler;

/** @var PDO $pdo */
$handler = new PDOHandler($pdo, 'table_name');

$handler->up();
```

Once the table has been created, the handler can be pushed to a `Logger` instance:

```
use Bayfront\MonologPDO\PDOHandler;
use Monolog\Logger;

$log = new Logger('channel_name');

/** @var PDO $pdo */
$handler = new PDOHandler($pdo, 'table_name');

$log->pushHandler($handler);
```

From here, your log records should appear in the MySQL table.

###  Health Score

33

—

LowBetter than 76% of packages

Maintenance43

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~247 days

Total

3

Last Release

454d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ad62c8d0e69358fd63b16fdaa71d5359231cd0cf660bbc3419071dc705c63a8?d=identicon)[bayfrontmedia](/maintainers/bayfrontmedia)

---

Top Contributors

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

---

Tags

logmysqlpdologgermonolog

### Embed Badge

![Health badge](/badges/bayfrontmedia-monolog-pdo/health.svg)

```
[![Health](https://phpackages.com/badges/bayfrontmedia-monolog-pdo/health.svg)](https://phpackages.com/packages/bayfrontmedia-monolog-pdo)
```

###  Alternatives

[wazaari/monolog-mysql

A handler for Monolog that sends messages to MySQL

140877.6k6](/packages/wazaari-monolog-mysql)[panique/pdo-debug

A super-simple function that returns the full SQL query from your PDO statements

70105.2k3](/packages/panique-pdo-debug)[markhilton/monolog-mysql

Laravel 8 MySQL driver for Monolog

42137.4k](/packages/markhilton-monolog-mysql)[bradmkjr/monolog-wordpress

A handler for Monolog that sends messages to MySQL via WordPress Functions

2817.1k](/packages/bradmkjr-monolog-wordpress)[itelmenko/laravel-mysql-logger

Laravel MySQL driver for Monolog

23140.1k](/packages/itelmenko-laravel-mysql-logger)[karelwintersky/monolog-pdo-handler

A handler for Monolog that stores data via PDO driver to Database

108.7k1](/packages/karelwintersky-monolog-pdo-handler)

PHPackages © 2026

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