{"id":36267586,"url":"https://github.com/linkorb/linkorb-app-event-bundle","last_synced_at":"2026-01-11T08:06:58.165Z","repository":{"id":57015229,"uuid":"201936492","full_name":"linkorb/linkorb-app-event-bundle","owner":"linkorb","description":"Integrates and provides a handy configuration for linkorb/app-event and its standard scheme for logging Application Events","archived":false,"fork":false,"pushed_at":"2022-10-06T09:49:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-15T02:52:24.792Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-12T13:31:54.000Z","updated_at":"2022-09-21T15:32:59.000Z","dependencies_parsed_at":"2022-08-22T09:30:35.137Z","dependency_job_id":null,"html_url":"https://github.com/linkorb/linkorb-app-event-bundle","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/linkorb/linkorb-app-event-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Flinkorb-app-event-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Flinkorb-app-event-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Flinkorb-app-event-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Flinkorb-app-event-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkorb","download_url":"https://codeload.github.com/linkorb/linkorb-app-event-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkorb%2Flinkorb-app-event-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28298004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T04:44:51.577Z","status":"ssl_error","status_checked_at":"2026-01-11T04:44:44.232Z","response_time":60,"last_error":"SSL_read: 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-11T08:06:55.341Z","updated_at":"2026-01-11T08:06:58.159Z","avatar_url":"https://github.com/linkorb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# linkorb/app-event-bundle\n\nIntegrates and provides a handy configuration for linkorb/app-event and its standard scheme for\nlogging Application Events.\n\nInstallation\n============\n\nApplications that use Symfony Flex\n----------------------------------\n\nOpen a command console, enter your project directory and execute:\n\n```console\n$ composer require linkorb/app-event-bundle\n```\n\nApplications that don't use Symfony Flex\n----------------------------------------\n\n### Step 1: Download the Bundle\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 linkorb/app-event-bundle\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\n### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `config/bundles.php` file of your project:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    LinkORB\\AppEventBundle\\LinkORBAppEventBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nUsage\n=====\n\nThe bundle will automatically inject a special App Event logger into services\nand controllers which implement AppEventLoggerAwareInterface.  There are a few\nways to achieve this.\n\nUse AppEventLoggerTrait which provides an implementation of both\nAppEventLoggerAwareInterface and AppEventLoggerInterface:\n\n```php\n\nuse LinkORB\\AppEvent\\AppEventLoggerAwareInterface;\nuse LinkORB\\AppEvent\\AppEventLoggerInterface;\nuse LinkORB\\AppEvent\\AppEventLoggerTrait;\n\nclass MyService implements AppEventLoggerAwareInterface,\n    AppEventLoggerInterface\n{\n    use AppEventLoggerTrait;\n\n    public function myMethod()\n    {\n        // using the trait makes it very simple to add AppEvent logging:\n        $this-\u003elog('my.app.event', ['some-info' =\u003e ...], 'notice');\n    }\n}\n```\n\nIf your Controllers extend Symfony's AbstractController you can instead make\nthem extend AppEventLoggingController which does the above for you and also\nextends Symfony's AbstractController:\n\n```php\n\nuse LinkORB\\AppEventBundle\\Logger\\AppEventLoggingController;\n\nclass MyController extends AppEventLoggingController\n{\n    public function myAction()\n    {\n        $this-\u003elog('my.app.event', ['some-info' =\u003e ...], 'notice');\n    }\n}\n```\n\nYour services can extend AppEventLoggingService to get the same benefit:\n\n```php\n\nuse LinkORB\\AppEventBundle\\Logger\\AppEventLoggingService;\n\nclass MyService extends AppEventLoggingService\n{\n    public function myMethod()\n    {\n        $this-\u003elog('my.app.event', ['some-info' =\u003e ...], 'notice');\n\n        // by omission of the third argument, log() will log to the minimum log\n        // level, which is whatever you set in the Monolog handler config\n        $this-\u003elog('my.app.event', ['some-info' =\u003e ...);\n\n        // you can also call the logger methods directly, but only do this\n        // when the bundle is configured in all environments\n        $this-\u003eappEventLogger-\u003eerror('my.app.event', ['some-info' =\u003e ...]);\n    }\n}\n```\n\nConfiguration\n=============\n\nYou need to create a Monolog configuration for each of the environments in\nwhich the bundle is enabled (which by default is all of them).  Put this in\neach of the Monolog config files:\n\n```yaml\nmonolog:\n  channels:\n    - app_event\n  handlers:\n    app_events:\n      type: stream\n      path: \"%kernel.logs_dir%/app-events-%kernel.environment%.ndjson\"\n      level: info\n      channels: [\"app_event\"]\n```\n\nIn the above config, we instruct Symfony's Monolog Bundle to create an\nadditional Logger service with the name `monolog.logger.app_event` and to\ncreate an instance of Monlog's StreamHandler which will be used by our logger\nto write to the file at `path`.  The minimum logging level for our logger is\nset to INFO.  This is the minimum you need to do to configure the logger, but\nthere are a few extra things you can configure.\n\nThe following configurations can be set independently in each environment, for\nexample you could place the directives in a file named\n`config/packages/prod/linkorb_app_event.yaml`.  If the bundle has been enabled\nin every environment then you can configure it simultaneously for all\nenvironments in `config/packages/linkorb_app_event.yaml`.\n\nYou can turn off the TokenProcessor which automatically adds information to App\nevents about the authenticated user:\n\n```yaml\nlinkorb_app_event:\n  token_processor: false\n```\n\nYou can turn on the TagProcessor which will add your tags to App events:\n\n```yaml\nlinkorb_app_event:\n  tag_processor:\n    tags:\n      mytag:\n      myothertag:\n      tagwithvalue: a-value\n```\n\nFinally there are a few things you can configure that you are unlikely to need.\n\nYou can change the name of the logging channel from the default `app_event`:\n\n```yaml\nlinkorb_app_event:\n  channel_name: \"my_channel_name\"\n```\n\nRemember to use this channel name instead of `app_event` in the Monolog config\nfiles.\n\nYou can also change the name of the logging handler from the default\n`app_events`:\n\n```yaml\nlinkorb_app_event:\n  handler_name: \"my_handler_name\"\n```\n\nRemember to use this handler name instead of `app_events` in the Monolog config\nfiles.\n\nHappy Application Event Logging!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Flinkorb-app-event-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkorb%2Flinkorb-app-event-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkorb%2Flinkorb-app-event-bundle/lists"}