phalcon/bridge-psr3

Phalcon Framework bridge classes for PSR-3

Maintainers

Package info

github.com/phalcon/bridge-psr3

pkg:composer/phalcon/bridge-psr3

Fund package maintenance!

phalcon

Open Collective

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v3.0.0 2026-06-25 02:50 UTC

This package is auto-updated.

Last update: 2026-06-25 09:21:13 UTC


README

PDS Skeleton Phalcon CI

Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.

Bridge PSR-3 connects the Phalcon logger and the PSR-3 (Psr\Log\LoggerInterface) standard in both directions:

  • Logger — a PSR-3 logger backed by Phalcon's logging adapters. Use it wherever a Psr\Log\LoggerInterface is expected.
  • Adapter — a Phalcon log adapter that forwards to a PSR-3 logger. Use it to make any PSR-3 logger (e.g. Monolog) act as a Phalcon log target.

Installation

You can install the package using composer

composer require phalcon/bridge-psr3

Usage

Logger — use Phalcon logging through a PSR-3 interface

Phalcon\Bridge\Psr3\Logger is a Psr\Log\LoggerInterface, configured with Phalcon logging adapters. Hand it to any code that expects a PSR-3 logger.

use Phalcon\Bridge\Psr3\Logger;
use Phalcon\Logger\Adapter\Stream;

$logger = new Logger(
    'my-app',
    [
        'main' => new Stream('/var/log/app.log'),
    ]
);

// $logger is a Psr\Log\LoggerInterface
$logger->info('User logged in', ['id' => 42]);
$logger->error('Payment failed');

Adapter — use a PSR-3 logger as a Phalcon log target

Phalcon\Bridge\Psr3\Adapter is a Phalcon log adapter that forwards to a wrapped PSR-3 logger. Add it to a Phalcon\Logger\Logger and inject that wherever Phalcon expects a logger.

use Phalcon\Bridge\Psr3\Adapter;
use Phalcon\Logger\Logger;

// Any Psr\Log\LoggerInterface, e.g. Monolog
$psr = new Monolog\Logger('my-app');

$logger = new Logger(
    'my-app',
    [
        'psr' => new Adapter($psr),
    ]
);

// Phalcon log calls now flow into the PSR-3 logger
$logger->warning('Low disk space');

// e.g. inject into the DataMapper profiler, which expects a Phalcon logger
$profiler = new Phalcon\DataMapper\Pdo\Profiler\Profiler($logger);

Links

General

Support

Social Media