{"id":16322740,"url":"https://github.com/shellscape/apollo-log","last_synced_at":"2025-05-12T15:44:23.705Z","repository":{"id":36327282,"uuid":"190100196","full_name":"shellscape/apollo-log","owner":"shellscape","description":"A logging extension for the Apollo GraphQL Server","archived":false,"fork":false,"pushed_at":"2021-11-24T03:13:53.000Z","size":409,"stargazers_count":67,"open_issues_count":5,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T22:39:18.668Z","etag":null,"topics":["apollo","apollo-graphql","apollo-server","apollographql","graphql","log","logger","logging","server"],"latest_commit_sha":null,"homepage":"https://shellscape.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellscape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-04T00:17:57.000Z","updated_at":"2024-07-17T09:52:11.000Z","dependencies_parsed_at":"2022-09-06T03:50:31.470Z","dependency_job_id":null,"html_url":"https://github.com/shellscape/apollo-log","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fapollo-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fapollo-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fapollo-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellscape%2Fapollo-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellscape","download_url":"https://codeload.github.com/shellscape/apollo-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253767486,"owners_count":21961116,"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":["apollo","apollo-graphql","apollo-server","apollographql","graphql","log","logger","logging","server"],"created_at":"2024-10-10T22:52:16.451Z","updated_at":"2025-05-12T15:44:23.680Z","avatar_url":"https://github.com/shellscape.png","language":"TypeScript","readme":"[tests]: https://img.shields.io/circleci/project/github/shellscape/apollo-log.svg\n[tests-url]: https://circleci.com/gh/shellscape/apollo-log\n[cover]: https://codecov.io/gh/shellscape/apollo-log/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/shellscape/apollo-log\n[size]: https://packagephobia.now.sh/badge?p=apollo-log\n[size-url]: https://packagephobia.now.sh/result?p=apollo-log\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src='https://user-images.githubusercontent.com/841294/53402609-b97a2180-39ba-11e9-8100-812bab86357c.png' height='100' alt='Apollo Server'\u003e\u003cbr/\u003e\u003cbr/\u003e\n\u003c/div\u003e\n\n[![tests][tests]][tests-url]\n[![cover][cover]][cover-url]\n[![size][size]][size-url]\n\n# apollo-log\n\nA logging plugin for Apollo GraphQL Server\n\n:heart: Please consider [Sponsoring my work](https://github.com/sponsors/shellscape)\n\n`apollo-server` doesn't ship with any comprehensive logging, and instead offloads that responsiblity to the users and the resolvers or context handler This module provides uniform logging for the entire GraphQL request lifecycle, as provided by plugin hooks in `apollo-server`. The console/terminal result of which will resemble the image below:\n\n\u003cimg src=\"https://github.com/shellscape/apollo-log/raw/master/.github/screen.png\" width=\"508\"\u003e\n\n## Requirements\n\n`apollo-log` is an [evergreen 🌲](./.github/FAQ.md#what-does-evergreen-mean) module.\n\nThis module requires an [Active LTS](https://github.com/nodejs/Release) Node version (v10.23.1+).\n\n## Install\n\nUsing npm:\n\n```console\nnpm install apollo-log\n```\n\n## Usage\n\nSetting up `apollo-log` is straight-forward. Import and call the plugin function, passing any desired options, and pass the plugin in an array to `apollo-server`.\n\n```js\nimport { ApolloLogPlugin } from 'apollo-log';\nimport { ApolloServer } from 'apollo-server';\n\nconst options = { ... };\nconst plugins = [ApolloLogPlugin(options)];\nconst apollo = new ApolloServer({\n  plugins,\n  ...\n});\n```\n\nPlease see the [Apollo Plugins](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#installing-a-plugin) documentation for more information.\n\n## Options\n\n### `events`\n\nType: `Record\u003cstring, boolean\u003e`\u003cbr\u003e\nDefault: \n```js\n{\n  didEncounterErrors: true,\n  didResolveOperation: false,\n  executionDidStart: false,\n  parsingDidStart: false,\n  responseForOperation: false,\n  validationDidStart: false,\n  willSendResponse: true\n}\n\n```\n\nSpecifies which [Apollo lifecycle events](https://www.apollographql.com/docs/apollo-server/integrations/plugins/#apollo-server-event-reference) will be logged. The `requestDidStart` event is always logged, and by default `didEncounterErrors` and `willSendResponse` are logged.\n\n### `mutate`\nType: `Function`\nDefault: `(data: Record\u003cstring, string\u003e) =\u003e Record\u003cstring, string\u003e`\n\nIf specified, allows inspecting and mutating the data logged to the console for each message.\n\n#### `prefix`\nType: `String`\u003cbr\u003e\nDefault: `apollo`\n\nSpecifies a prefix, colored by level, prepended to each log message.\n\n#### `timestamp`\nType: `Boolean`\n\nIf `true`, will prepend a timestamp in the `HH:mm:ss` format to each log message.\n\n## Meta\n\n[CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n[LICENSE (Mozilla Public License)](./LICENSE)\n```\n","funding_links":["https://github.com/sponsors/shellscape"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Fapollo-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellscape%2Fapollo-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellscape%2Fapollo-log/lists"}