{"id":51616627,"url":"https://github.com/phalcon/bridge-psr3","last_synced_at":"2026-07-12T14:01:37.049Z","repository":{"id":369576835,"uuid":"1279238401","full_name":"phalcon/bridge-psr3","owner":"phalcon","description":"Bridge PSR-3 connects the Phalcon logger and the PSR-3 (Psr\\Log\\LoggerInterface) standard in both directions","archived":false,"fork":false,"pushed_at":"2026-07-06T01:57:36.000Z","size":172,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-06T02:10:14.395Z","etag":null,"topics":["bridge","phalcon","psr","psr-3"],"latest_commit_sha":null,"homepage":"https://phalcon.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phalcon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"phalcon","open_collective":"phalcon"}},"created_at":"2026-06-24T13:54:51.000Z","updated_at":"2026-07-06T01:57:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/phalcon/bridge-psr3","commit_stats":null,"previous_names":["phalcon/bridge-psr3"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phalcon/bridge-psr3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalcon","download_url":"https://codeload.github.com/phalcon/bridge-psr3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35393398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bridge","phalcon","psr","psr-3"],"created_at":"2026-07-12T14:01:34.004Z","updated_at":"2026-07-12T14:01:37.038Z","avatar_url":"https://github.com/phalcon.png","language":"PHP","funding_links":["https://github.com/sponsors/phalcon","https://opencollective.com/phalcon"],"categories":[],"sub_categories":[],"readme":"# Phalcon Framework - Bridge PSR-3\n\n[![Bridge PSR-3 CI][ci-badge]][ci-link]\n[![Quality Gate Status][sonar-quality-badge]][sonar-link]\n[![Coverage][sonar-coverage-badge]][sonar-link]\n[![PDS Skeleton][pds-skeleton-badge]][pds-skeleton-link]\n\nPhalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.\n\nBridge PSR-3 connects the Phalcon logger and the PSR-3 (`Psr\\Log\\LoggerInterface`) standard in both directions:\n\n* **`Logger`** - a PSR-3 logger backed by Phalcon's logging adapters. Use it wherever a `Psr\\Log\\LoggerInterface` is expected.\n* **`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.\n\n## Installation\n\nYou can install the package using composer\n\n```sh\ncomposer require phalcon/bridge-psr3\n```\n\n## Usage\n\n### `Logger` - use Phalcon logging through a PSR-3 interface\n\n`Phalcon\\Bridge\\Psr3\\Logger` *is* a `Psr\\Log\\LoggerInterface`, configured with\nPhalcon logging adapters. Hand it to any code that expects a PSR-3 logger.\n\n```php\nuse Phalcon\\Bridge\\Psr3\\Logger;\nuse Phalcon\\Logger\\Adapter\\Stream;\n\n$logger = new Logger(\n    'my-app',\n    [\n        'main' =\u003e new Stream('/var/log/app.log'),\n    ]\n);\n\n// $logger is a Psr\\Log\\LoggerInterface\n$logger-\u003einfo('User logged in', ['id' =\u003e 42]);\n$logger-\u003eerror('Payment failed');\n```\n\n### `Adapter` - use a PSR-3 logger as a Phalcon log target\n\n`Phalcon\\Bridge\\Psr3\\Adapter` is a Phalcon log adapter that forwards to a\nwrapped PSR-3 logger. Add it to a `Phalcon\\Logger\\Logger` and inject that\nwherever Phalcon expects a logger.\n\n```php\nuse Phalcon\\Bridge\\Psr3\\Adapter;\nuse Phalcon\\Logger\\Logger;\n\n// Any Psr\\Log\\LoggerInterface, e.g. Monolog\n$psr = new Monolog\\Logger('my-app');\n\n$logger = new Logger(\n    'my-app',\n    [\n        'psr' =\u003e new Adapter($psr),\n    ]\n);\n\n// Phalcon log calls now flow into the PSR-3 logger\n$logger-\u003ewarning('Low disk space');\n\n// e.g. inject into the DataMapper profiler, which expects a Phalcon logger\n$profiler = new Phalcon\\DataMapper\\Pdo\\Profiler\\Profiler($logger);\n```\n\n## Development\n\nThe repository ships a Docker setup for local development and testing. You only need Docker +\nDocker Compose; the PHP runtime and Phalcon are provided inside the container.\n\n### Quick start\n\n```bash\ndocker compose up -d --build\ndocker compose exec app composer install\ndocker compose exec app composer test\n```\n\n\u003e `app` is the Compose *service* name. The running container is `bridge-psr3-app` (override with\n\u003e `PROJECT_PREFIX`). It stays up via a `sleep infinity` keepalive, so you can\n\u003e `docker compose exec app \u003ccmd\u003e` freely (e.g. `composer update`).\n\n### Choosing the PHP version\n\nThe image is built for one PHP version at a time, selected with the `PHP_VERSION` build arg\n(default `8.5`; supported `8.1`–`8.5`). Because it is a **build** arg, changing it requires a\nrebuild (`--build`):\n\n```bash\ndocker compose up -d --build                  # PHP 8.5 (default)\nPHP_VERSION=8.1 docker compose up -d --build  # PHP 8.1\nPHP_VERSION=8.4 docker compose up -d --build  # PHP 8.4\n```\n\nThe container keeps the same name, so each rebuild **replaces** the previous one. To run several\nversions side by side, give each its own Compose project and prefix:\n\n```bash\nPHP_VERSION=8.1 PROJECT_PREFIX=bridge-psr3-81 docker compose -p bridge-psr3-81 up -d --build\n# then: docker exec -w /srv bridge-psr3-81-app composer test\n```\n\n### Choosing the backend\n\nThe bridge works against either Phalcon runtime, selected with the `PHALCON_VARIANT` build arg:\n\n```bash\ndocker compose up -d --build                     # package: phalcon/phalcon (v6, default)\nPHALCON_VARIANT=ext docker compose up -d --build  # ext: cphalcon C extension (v5)\n```\n\nTip: drop `PHP_VERSION` / `PHALCON_VARIANT` into a `.env` file in the repo root to avoid prefixing\nevery command — Compose reads it automatically.\n\n### Composer scripts\n\nRun them inside the container, e.g. `docker compose exec app composer cs`:\n\n| Script | Description |\n| --- | --- |\n| `composer cs` | PHP_CodeSniffer (PSR-12) |\n| `composer cs-fix` | Auto-fix coding-standard issues (phpcbf) |\n| `composer cs-fixer` | PHP CS Fixer (dry-run) |\n| `composer cs-fixer-fix` | Apply PHP CS Fixer |\n| `composer analyze` | PHPStan static analysis |\n| `composer test` / `composer test-unit` | Unit tests via [`phalcon/talon`](https://github.com/phalcon/talon) |\n| `composer test-coverage` | Tests + Clover coverage (`tests/_output/coverage.xml`) |\n\n## Links\n\n### General\n* [Official Documentation](https://docs.phalcon.io/)\n\n### Support\n* [Forum](https://phalcon.io/forum)\n* [Discord](https://phalcon.io/discord)\n* [Stack Overflow](https://phalcon.io/so)\n\n### Social Media\n* [Telegram](https://phalcon.io/telegram)\n* [Gab](https://phalcon.io/gab)\n* [LinkedIn](https://phalcon.io/linkedin)\n* [MeWe](https://phalcon.io/mewe)\n* [Facebook](https://phalcon.io/fb)\n* [Twitter](https://phalcon.io/t)\n\n\n\u003c!-- External links should be here --\u003e\n[ci-badge]:             https://github.com/phalcon/bridge-psr3/actions/workflows/main.yml/badge.svg?branch=master\n[ci-link]:              https://github.com/phalcon/bridge-psr3/actions/workflows/main.yml\n[sonar-quality-badge]:  https://sonarcloud.io/api/project_badges/measure?project=phalcon_bridge-psr3\u0026metric=alert_status\n[sonar-coverage-badge]: https://sonarcloud.io/api/project_badges/measure?project=phalcon_bridge-psr3\u0026metric=coverage\n[sonar-link]:           https://sonarcloud.io/summary/new_code?id=phalcon_bridge-psr3\n[pds-skeleton-badge]:   https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square\n[pds-skeleton-link]:    https://github.com/php-pds/skeleton\n[discord-badge]:        https://img.shields.io/discord/310910488152375297?label=Discord\u0026logo=discord\u0026style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fbridge-psr3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalcon%2Fbridge-psr3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fbridge-psr3/lists"}