phalcon/bridge-psr3
Composer 安装命令:
composer require phalcon/bridge-psr3
包简介
Phalcon Framework bridge classes for PSR-3
关键字:
README 文档
README
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 aPsr\Log\LoggerInterfaceis 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
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-25