PHPackages                             programster/pgsql-logger - 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. programster/pgsql-logger

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

programster/pgsql-logger
========================

A logger that logs to a PostgreSQL database and is compatible with PSR-3

1.0.0(2y ago)181MITPHPPHP &gt;=8.1.0

Since Nov 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/programster/package-pgsql-logger)[ Packagist](https://packagist.org/packages/programster/pgsql-logger)[ Docs](https://github.com/programster/package-pgsql-logger)[ RSS](/packages/programster-pgsql-logger/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (2)Used By (0)

PostgreSQL Logger Package
=========================

[](#postgresql-logger-package)

A PSR-3 logger for logging to a PostgreSQL database in PHP.

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

[](#installation)

```
composer require programster/pgsql-logger
```

Example Usage
-------------

[](#example-usage)

```
# Connect to your database
$pgsqlConn = pg_connect($connectionString);

# Create the logger using your Pgsql connection.
$logger = new \Programster\PgsqlLogger\PgSqlLogger($pgsqlConn);

# Create some logs using the standard PSR-3 interface
$logger->debug("This is an info log");
$logger->notice("This is a notice log", ['name' => 'value']);
$logger->info("This is an info log", ['name' => 'value']);
$logger->warning("This is a warning log", ['name' => 'value']);
$logger->alert("This is an alert log", ['name' => 'value']);
$logger->emergency("This is an emergency log", ['name' => 'value']);
$logger->critical("This is a critical log", ['name' => 'value']);
$logger->log(\Psr\Log\LogLevel::WARNING, "This is another warning log", ['name' => 'value']);
```

Testing
-------

[](#testing)

Spin up a test database using the docker-compose.yml file, before running the `main.php` script that will test connecting to the database and creating some logs.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

949d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64a048ca8be761aced9419279975a21ef679b71c70d8263bc2fc413a87ad381c?d=identicon)[programster](/maintainers/programster)

---

Top Contributors

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

---

Tags

logloggingpgsql

### Embed Badge

![Health badge](/badges/programster-pgsql-logger/health.svg)

```
[![Health](https://phpackages.com/badges/programster-pgsql-logger/health.svg)](https://phpackages.com/packages/programster-pgsql-logger)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k247.1M335](/packages/sentry-sentry)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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