{"id":22894253,"url":"https://github.com/clearcodehq/simplebuselkbundle","last_synced_at":"2025-05-07T19:20:55.084Z","repository":{"id":56953655,"uuid":"47963148","full_name":"ClearcodeHQ/SimpleBusElkBundle","owner":"ClearcodeHQ","description":"Logs SimpleBus messages in ELK","archived":false,"fork":false,"pushed_at":"2016-01-27T09:15:15.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T13:37:09.630Z","etag":null,"topics":[],"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/ClearcodeHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-14T08:57:26.000Z","updated_at":"2016-07-10T14:49:55.000Z","dependencies_parsed_at":"2022-08-21T08:20:38.810Z","dependency_job_id":null,"html_url":"https://github.com/ClearcodeHQ/SimpleBusElkBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2FSimpleBusElkBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2FSimpleBusElkBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2FSimpleBusElkBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ClearcodeHQ%2FSimpleBusElkBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ClearcodeHQ","download_url":"https://codeload.github.com/ClearcodeHQ/SimpleBusElkBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252941366,"owners_count":21828862,"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","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":"2024-12-13T23:17:19.347Z","updated_at":"2025-05-07T19:20:55.065Z","avatar_url":"https://github.com/ClearcodeHQ.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ClearcodeHQ/SimpleBusElkBundle.svg?branch=master)](https://travis-ci.org/ClearcodeHQ/SimpleBusElkBundle)\n[![Coverage Status](https://coveralls.io/repos/ClearcodeHQ/SimpleBusElkBundle/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/ClearcodeHQ/SimpleBusElkBundle?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ClearcodeHQ/SimpleBusElkBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ClearcodeHQ/SimpleBusElkBundle/?branch=master)\n\n# ELK Bridge for Symfony2\n\n## How to use:\n\n### Requirements:\n\nELK installed, Logstash config:\n\n```\ninput {\n  tcp {\n    port =\u003e 5000\n    codec =\u003e \"json\"\n  }\n}\n\noutput {\n  elasticsearch { }\n}\n```\n\nTested on ELK docker: https://github.com/deviantony/docker-elk\n\n### Installation \u0026 configuration:\n\n##### I. Register a bundle\n\n```php\n\u003c?php\n\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            ...\n            new Clearcode\\SimpleBusElkBundle\\SimpleBusElkBundle(),\n            ...\n        )\n    }\n    ...\n}\n```\n\n##### II. Add this line to your config file:\n\n```yaml\nsimple_bus_elk:\n    middleware: true\n    logstash_namespace: your_app\n    monolog_channel: simple_bus_elk\n\nmonolog:\n    channels: [\"simple_bus_elk\"]\n    handlers:\n        simple_bus_logstash:\n            type: socket\n            connection_string: localhost:5000 // \u003c-- this part can be parametrized!\n            level: debug\n            channels: [\"simple_bus_elk\"]\n            formatter: simple_bus_elk.monolog.logstash_formatter // \u003c-- you can use our default, beautiful formatter or write your own if you want to!\n```\n\n##### III. Enable monolog logger in service:\n\n1. If you are using SimpleBus bundle just set ``simple_bus_elk.middleware`` to ``true``. It will enable Event middleware which will log your events automatically on ELK.\n\n2. Otherwise, just use our monolog channel as follow:\n\n```yaml\nservices:\n    service.do_amazing_thing:\n        ...\n        arguments:\n            ...\n            - @logger\n        tags:\n            ...\n            - { name: monolog.logger, channel: '%simple_bus_elk.channel%' }\n```\n\n(see Clearcode\\SimpleBusElkBundle\\CommandBus\\LogEventMiddleware as example)\n\n###### Note:\n\n``simple_bus_elk.logstash_namespace`` will be logged in ``@type`` field in Kibana. We suggest to change it to name of project, from which you want to log events\n(it is important especially if you want to log events from more than one project in one ELK instance).\n\n``simple_bus_elk.channel`` will be logged in ``@fields.channel`` \u0026 ``@tags`` fields in Kibana. It is important when you log something else in ELK instance\nat the same Kibana's index pattern.\n\n# Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fsimplebuselkbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearcodehq%2Fsimplebuselkbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearcodehq%2Fsimplebuselkbundle/lists"}