phalcon/bridge-psr3 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phalcon/bridge-psr3

Composer 安装命令:

composer require phalcon/bridge-psr3

包简介

Phalcon Framework bridge classes for PSR-3

README 文档

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固