{"id":15021941,"url":"https://github.com/macpaw/sentry-monolog-adapter","last_synced_at":"2025-08-12T17:45:02.185Z","repository":{"id":39972259,"uuid":"335527382","full_name":"MacPaw/sentry-monolog-adapter","owner":"MacPaw","description":"Symfony Sentry Monolog Adapter","archived":false,"fork":false,"pushed_at":"2025-08-06T13:06:05.000Z","size":288,"stargazers_count":25,"open_issues_count":1,"forks_count":2,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-08-06T15:10:40.083Z","etag":null,"topics":["backend","logging","macpaw","messenger","monolog","php","php-library","sentry","symfony-bundle"],"latest_commit_sha":null,"homepage":"","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/MacPaw.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-03T06:18:36.000Z","updated_at":"2025-08-06T13:06:10.000Z","dependencies_parsed_at":"2025-04-12T07:01:30.640Z","dependency_job_id":null,"html_url":"https://github.com/MacPaw/sentry-monolog-adapter","commit_stats":{"total_commits":96,"total_committers":5,"mean_commits":19.2,"dds":"0.41666666666666663","last_synced_commit":"c2a4d703a2292df6eece3d22b97f070418cfa2d9"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/MacPaw/sentry-monolog-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacPaw%2Fsentry-monolog-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacPaw%2Fsentry-monolog-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacPaw%2Fsentry-monolog-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacPaw%2Fsentry-monolog-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MacPaw","download_url":"https://codeload.github.com/MacPaw/sentry-monolog-adapter/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacPaw%2Fsentry-monolog-adapter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270108843,"owners_count":24528772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["backend","logging","macpaw","messenger","monolog","php","php-library","sentry","symfony-bundle"],"created_at":"2024-09-24T19:57:14.683Z","updated_at":"2025-08-12T17:45:02.164Z","avatar_url":"https://github.com/MacPaw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Symfony Sentry Monolog Adapter\n=================================\n\n| Version | Build Status | Code Coverage |\n|:---------:|:-------------:|:-----:|\n| `master`| [![CI][master Build Status Image]][master Build Status] | [![Coverage Status][master Code Coverage Image]][master Code Coverage] |\n| `develop`| [![CI][develop Build Status Image]][develop Build Status] | [![Coverage Status][develop Code Coverage Image]][develop Code Coverage] |\n\nThe Sentry Monolog Adapter is a Symfony bundle designed to enhance and provide granular control over logging to Sentry. It is particularly powerful for applications that use the Symfony Messenger component, allowing you to implement intelligent logging strategies to avoid log floods and focus on critical errors.\n\n### Key Features\n\n*   **Advanced Log Processing**: Utilizes a decorator for Monolog's Sentry handler to process and enrich log records before they are sent.\n*   **Customizable Processors**: Add your own processors to include or modify contextual data, with a built-in `ExceptionProcessor` to get you started.\n*   **Intelligent Messenger Logging**: A dedicated middleware for the Symfony Messenger component that allows you to control which messages are logged based on flexible strategies.\n*   **Built-in Logging Strategies**: A suite of strategies is provided out-of-the-box, including:\n    *   `LogAllFailedStrategy`: Only logs messages that fail.\n    *   `LogAfterPositionStrategy`: Logs messages after a specific number of retries.\n    *   `ArithmeticProgressionStrategy`: Logs based on an arithmetic sequence of retry attempts.\n    *   And several others to fit your needs.\n*   **Modern and Compatible**: Built for PHP 8.1+ and compatible with `sentry/sentry-symfony` v5.\n\n\nInstallation\n============\n\nStep 1: Download the Bundle\n----------------------------------\nOpen a command console, enter your project directory and execute:\n\n###  Applications that use Symfony Flex\n\n```console\n$ composer require macpaw/sentry-monolog-adapter\n```\n\n### Applications that don't use Symfony Flex\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```console\n$ composer require macpaw/sentry-monolog-adapter\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\nStep 2: Enable the Bundle\n----------------------------------\nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            SentryMonologAdapter\\SentryMonologAdapterBundle::class =\u003e ['all' =\u003e true],\n        );\n\n        // ...\n    }\n\n    // ...\n}\n```\n\nCreate Sentry Monolog Adapter Config:\n----------------------------------\n`config/packages/sentry_monolog_adapter.yaml `\n\nConfigurating logging strategies of MessengerLoggingMiddleware - all strategies you can see [here](https://github.com/MacPaw/sentry-monolog-adapter/tree/master/src/Messenger/LoggingStrategy).\n\n```yaml\nsentry_monolog_adapter:\n    messenger_logging_middleware:\n        logging_strategies: // array of logging strategies\n            - id: sentry_monolog_adapter.log_after_position_strategy\n              options:\n                  position: 3\n            - id: sentry_monolog_adapter.log_all_failed_strategy\n\n```\n\nStep 3: Configuration\n=============\n\nMonolog:\n----------------------------------\n`config/packages/monolog.yaml `\n\n```yaml\n        sentry:\n            type: service\n            id: sentry_monolog_adapter.monolog_handler_decorator\n```\n\n\nMessenger:\n----------------------------------\n`config/packages/messenger.yaml `\n```\n        middleware:\n            ....\n            - sentry_monolog_adapter.messenger_logging_middleware\n            ....\n```\n\nStep 4: Additional settings\n=============\nIt is possible to add preprocessors for putting your parameters to the additional data.\nOur library provides a [basic implementation](https://github.com/MacPaw/sentry-monolog-adapter/blob/feat/addDefaultProcessor/src/Processor/ExceptionProcessor.php), but at any time we can replace it with our own implementation\n```yaml\nsentry_monolog_adapter:\n    monolog_handler_decorator:\n        processors:\n            - sentry_monolog_adapter.exception_processor\n```\n[master Build Status]: https://github.com/macpaw/sentry-monolog-adapter/actions?query=workflow%3ACI+branch%3Amaster\n[master Build Status Image]: https://github.com/macpaw/sentry-monolog-adapter/workflows/CI/badge.svg?branch=master\n[develop Build Status]: https://github.com/macpaw/sentry-monolog-adapter/actions?query=workflow%3ACI+branch%3Adevelop\n[develop Build Status Image]: https://github.com/macpaw/sentry-monolog-adapter/workflows/CI/badge.svg?branch=develop\n[master Code Coverage]: https://codecov.io/gh/macpaw/sentry-monolog-adapter/branch/master\n[master Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/sentry-monolog-adapter/master?logo=codecov\n[develop Code Coverage]: https://codecov.io/gh/macpaw/sentry-monolog-adapter/branch/develop\n[develop Code Coverage Image]: https://img.shields.io/codecov/c/github/macpaw/sentry-monolog-adapter/develop?logo=codecov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacpaw%2Fsentry-monolog-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacpaw%2Fsentry-monolog-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacpaw%2Fsentry-monolog-adapter/lists"}