{"id":36645737,"url":"https://github.com/zendtech/zendhq-monolog-handler","last_synced_at":"2026-01-12T10:00:06.566Z","repository":{"id":190409336,"uuid":"682596573","full_name":"zendtech/zendhq-monolog-handler","owner":"zendtech","description":"Monolog handler that pushes to ZendHQ monitoring","archived":false,"fork":false,"pushed_at":"2024-11-25T19:43:13.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"0.1.x","last_synced_at":"2025-11-17T21:34:56.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zendtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"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}},"created_at":"2023-08-24T14:06:36.000Z","updated_at":"2024-11-25T19:41:53.000Z","dependencies_parsed_at":"2024-12-01T23:01:25.836Z","dependency_job_id":null,"html_url":"https://github.com/zendtech/zendhq-monolog-handler","commit_stats":null,"previous_names":["zendtech/zendhq-monolog-handler"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zendtech/zendhq-monolog-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendtech%2Fzendhq-monolog-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendtech%2Fzendhq-monolog-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendtech%2Fzendhq-monolog-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendtech%2Fzendhq-monolog-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zendtech","download_url":"https://codeload.github.com/zendtech/zendhq-monolog-handler/tar.gz/refs/heads/0.1.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zendtech%2Fzendhq-monolog-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-12T10:00:06.407Z","updated_at":"2026-01-12T10:00:06.504Z","avatar_url":"https://github.com/zendtech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zendtech/zendhq-monolog-handler\n\nThis project provides a handler for [Monolog](https://seldaek.github.io/monolog/) that pushes to [ZendHQ](https://www.zend.com/products/zendphp-enterprise/zendhq) monitoring.\n\n## Installation\n\n```bash\ncomposer require zendtech/zendhq-monolog-handler\n```\n\n### Requirements\n\n- A ZendHQ node\n- ZendPHP \u003e= 7.2\n- The ZendHQ extension\n- Monolog 2.4+ or 3.4+\n\n## Usage\n\nThe below examples demonstrate how to create a `ZendHQHandler` instance for use in writing logs with Monolog.\n\n### Default instantiation\n\nDefault usage is to use Monolog/PSR-3 log levels to indicate severity.\nYou can instantiate the provided `ZendTech\\ZendHQ\\MonologHandler\\ZendHQHandler` class without any arguments, or with the `$level` and/or `$bubble` arguments:\n\n```php\nuse Monolog\\Logger;\nuse ZendTech\\ZendHQ\\MonologHandler\\ZendHQHandler;\n\n// PHP 7:\n// - Default level (DEBUG) and allowing bubbling:\n$handler = new ZendHQHandler();\n\n// - Setting a level mask of warnings or greater only:\n$handler = new ZendHQHandler(null, Logger::WARNING);\n\n// - Default level (DEBUG), but disallowing bubbling\n$handler = new ZendHQHandler(null, Logger::DEBUG, false);\n\n// PHP 8:\n// - Default level (DEBUG) and allowing bubbling:\n$handler = new ZendHQHandler();\n\n// - Setting a level mask of warnings or greater only:\n$handler = new ZendHQHandler(level: Logger::WARNING);\n\n// - Default level (DEBUG), but disallowing bubbling\n$handler = new ZendHQHandler(bubble: false);\n```\n\n### Instantiation for usage with named rules\n\nZendHQ custom monitoring rules will specify severity in the rule definition, so severity is ignored.\nTo use such custom rules, provide the custom rule name when instantiating `ZendHQHandler`.\nThe following examples target a \"my_custom_rule\" rule.\nWhile you _can_ provide a default level to handle, the value will not be sent to ZendHQ, and only used to determine if a message will get logged.\n\n```php\nuse Monolog\\Logger;\nuse ZendTech\\ZendHQ\\MonologHandler\\ZendHQHandler;\n\n// PHP 7:\n// - Default level (DEBUG) and allowing bubbling:\n$handler = new ZendHQHandler('my_custom_rule');\n\n// - Setting a level mask of warnings or greater only:\n$handler = new ZendHQHandler('my_custom_rule', Logger::WARNING);\n\n// - Default level (DEBUG), but disallowing bubbling\n$handler = new ZendHQHandler('my_custom_rule', Logger::DEBUG, false);\n\n// PHP 8:\n// - Default level (DEBUG) and allowing bubbling:\n$handler = new ZendHQHandler('my_custom_rule');\n\n// - Setting a level mask of warnings or greater only:\n$handler = new ZendHQHandler('my_custom_rule', level: Logger::WARNING);\n\n// - Default level (DEBUG), but disallowing bubbling\n$handler = new ZendHQHandler('my_custom_rule', bubble: false);\n```\n\n### Formatters and Processors\n\nThe `ZendHQHandler` implements each of `Monolog\\Handler\\ProcessableHandlerInterface` and `Monolog\\Handler\\FormattableHandlerInterface`.\nAs such, you can attach processors and formatters to your handler in order to manipulate the information logged.\nSee the [Monolog documentation on formatters and processors](http://seldaek.github.io/monolog/doc/02-handlers-formatters-processors.html) for more details.\n\nAs examples:\n\n```php\n$handler-\u003esetFormatter(new \\Monolog\\Formatter\\LineFormatter());\n$handler-\u003epushProcessor(new \\Monolog\\Processor\\PsrLogMessageProcessor());\n```\n\n### Adding the handler to Monolog\n\nMonolog writes to _channels_, which are essentially just a way of partitioning different logs from each other.\n\n```php\nuse Monolog\\Logger;\n\n$logger = new Logger('channel_name');\n```\n\nFrom here, you need to add the handler to the logger:\n\n```php\n// Where $handler is the instance created via one of the examples in previous sections\n$logger-\u003epushHandler($handler);\n```\n\nTo log, use one of the various logging methods of the `$logger` instance:\n\n```php\n$logger-\u003ewarning('This is a warning!');\n```\n\n## Notes\n\n- The channel name is sent to ZendHQ monitoring events as the _type_; you will see this in the event drawer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendtech%2Fzendhq-monolog-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzendtech%2Fzendhq-monolog-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzendtech%2Fzendhq-monolog-handler/lists"}